From fca651aacf53aba77b90cb6327e08e05882de07a Mon Sep 17 00:00:00 2001 From: leufen1 <l.leufen@fz-juelich.de> Date: Tue, 16 May 2023 14:32:38 +0200 Subject: [PATCH] revert some changes to make it compatible with older versions --- mlair/run_modules/model_setup.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/mlair/run_modules/model_setup.py b/mlair/run_modules/model_setup.py index 3164db78..3933d8d6 100644 --- a/mlair/run_modules/model_setup.py +++ b/mlair/run_modules/model_setup.py @@ -68,8 +68,8 @@ class ModelSetup(RunEnvironment): self.model_load_path = None path = self._set_model_path() self.model_path = path % "%s.h5" - self.checkpoint_name = path % "_model-best.h5" - self.callbacks_name = path % "_model-best-callbacks-%s.pickle" + self.checkpoint_name = path % "model-best.h5" + self.callbacks_name = path % "model-best-callbacks-%s.pickle" self._run() def _run(self): @@ -111,7 +111,7 @@ class ModelSetup(RunEnvironment): f"create_new_model={self._create_new_model} is not possible. Either set both " f"parameters to False or remove `model_path` parameter. Given was: model_path = " f"{self.model_load_path}") - return os.path.join(self.path, f"{self.model_display_name or exp_name}%s") + return os.path.join(self.path, f"{exp_name}_%s") def _set_shapes(self): """Set input and output shapes from train collection.""" @@ -220,8 +220,7 @@ class ModelSetup(RunEnvironment): model_settings = self.model.get_settings() self.data_store.set_from_dict(model_settings, self.scope, log=True) generic_model_name = self.data_store.get_default("model_name", self.scope, "my_model") - model_annotation = generic_model_name if self.model_display_name is None else "" - self.model_path = self.model_path % model_annotation + self.model_path = self.model_path % generic_model_name self.data_store.set("model_name", self.model_path, self.scope) def plot_model(self): # pragma: no cover -- GitLab