Skip to content
Snippets Groups Projects
Commit df8e3cba authored by lukas leufen's avatar lukas leufen
Browse files

added missing lr availability checks

parent 4b8d8cdc
No related branches found
No related tags found
3 merge requests!90WIP: new release update,!89Resolve "release branch / CI on gpu",!73Resolve "lr_decay should be optional"
Pipeline #31874 passed
......@@ -111,7 +111,10 @@ class Training(RunEnvironment):
callbacks=self.callbacks.get_callbacks(as_dict=False),
initial_epoch=initial_epoch)
history = hist
try:
lr = self.callbacks.get_callback_by_name("lr")
except IndexError:
lr = None
self.save_callbacks_as_json(history, lr)
self.load_best_model(checkpoint.filepath)
self.create_monitoring_plots(history, lr)
......@@ -148,6 +151,7 @@ class Training(RunEnvironment):
path = self.data_store.get("experiment_path", "general")
with open(os.path.join(path, "history.json"), "w") as f:
json.dump(history.history, f)
if lr_sc:
with open(os.path.join(path, "history_lr.json"), "w") as f:
json.dump(lr_sc.lr, f)
......@@ -174,4 +178,5 @@ class Training(RunEnvironment):
PlotModelHistory(filename=filename, history=history, plot_metric="mse", main_branch=multiple_branches_used)
# plot learning rate
if lr_sc:
PlotModelLearningRate(filename=os.path.join(path, f"{name}_history_learning_rate.pdf"), lr_sc=lr_sc)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment