From a69c809008d52438052c90c279cc6c21dfed1097 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Wed, 11 Jan 2023 17:26:57 +0000 Subject: [PATCH] dlr: slurm, load checkpoint --- aimodel/slurm-TEST-deeplabv3p-rainfall.job | 1 + aimodel/src/deeplabv3_plus_test_rainfall.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/aimodel/slurm-TEST-deeplabv3p-rainfall.job b/aimodel/slurm-TEST-deeplabv3p-rainfall.job index 5ed5afd..3479d38 100755 --- a/aimodel/slurm-TEST-deeplabv3p-rainfall.job +++ b/aimodel/slurm-TEST-deeplabv3p-rainfall.job @@ -30,6 +30,7 @@ show_help() { echo -e " DIR_RAINFALLWATER The path to the directory the .tfrecord files containing the rainfall radar / water depth data." >&2; echo -e " PATH_HEIGHTMAP The path to the heightmap jsonl file to read in." >&2; echo -e " PATH_COLOURMAP The path to the colourmap for predictive purposes." >&2; + echo -e " PATH_CHECKPOINT The path to a checkcpoint to load. If specified, a model will be loaded instead of being trained." >&2; echo -e " STEPS_PER_EPOCH The number of steps to consider an epoch. Defaults to None, which means use the entire dataset." >&2; echo -e " POSTFIX Postfix to append to the output dir (auto calculated)." >&2; echo -e " ARGS Optional. Any additional arguments to pass to the python program." >&2; diff --git a/aimodel/src/deeplabv3_plus_test_rainfall.py b/aimodel/src/deeplabv3_plus_test_rainfall.py index 2113c68..c7afba1 100755 --- a/aimodel/src/deeplabv3_plus_test_rainfall.py +++ b/aimodel/src/deeplabv3_plus_test_rainfall.py @@ -132,7 +132,8 @@ if PATH_CHECKPOINT is None: model = DeeplabV3Plus(image_size=IMAGE_SIZE, num_classes=NUM_CLASSES, num_channels=8) summarywriter(model, os.path.join(DIR_OUTPUT, "summary.txt")) - +else: + model = tf.keras.models.load_model(PATH_CHECKPOINT)