From 5e0a5b214bccf3a14c523e0397472cea7c06babf Mon Sep 17 00:00:00 2001
From: leufen1 <l.leufen@fz-juelich.de>
Date: Tue, 16 Feb 2021 15:19:15 +0100
Subject: [PATCH] first fix, include custom objects in model loading

---
 mlair/run_modules/training.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mlair/run_modules/training.py b/mlair/run_modules/training.py
index 113765e0..3878e79c 100644
--- a/mlair/run_modules/training.py
+++ b/mlair/run_modules/training.py
@@ -145,7 +145,7 @@ class Training(RunEnvironment):
             logging.info("Found locally stored model and checkpoints. Training is resumed from the last checkpoint.")
             self.callbacks.load_callbacks()
             self.callbacks.update_checkpoint()
-            self.model = keras.models.load_model(checkpoint.filepath)
+            self.model = keras.models.load_model(checkpoint.filepath, self.model.custom_objects)
             hist: History = self.callbacks.get_callback_by_name("hist")
             initial_epoch = max(hist.epoch) + 1
             _ = self.model.fit_generator(generator=self.train_set,
-- 
GitLab