From 96eae636eafa8416cc414c696c525d94b5b46323 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Thu, 9 Mar 2023 19:26:57 +0000 Subject: [PATCH] dir: add missing functions to .load() custom objs apparently metrics are also required to be included here... --- aimodel/src/deeplabv3_plus_test_rainfall.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aimodel/src/deeplabv3_plus_test_rainfall.py b/aimodel/src/deeplabv3_plus_test_rainfall.py index b996766..f73819b 100755 --- a/aimodel/src/deeplabv3_plus_test_rainfall.py +++ b/aimodel/src/deeplabv3_plus_test_rainfall.py @@ -163,6 +163,10 @@ else: model = tf.keras.models.load_model(PATH_CHECKPOINT, custom_objects={ # Tell Tensorflow about our custom layers so that it can deserialise models that use them "LossCrossEntropyDice": LossCrossEntropyDice, + "metric_dice_coefficient": dice_coefficient, + "make_sensitivity": sensitivity, + "specificity": specificity, + "make_one_hot_mean_iou": mean_iou })