From 90eb0b2ef2617f1efb5481f38b3428793583c5d3 Mon Sep 17 00:00:00 2001
From: leufen1 <l.leufen@fz-juelich.de>
Date: Tue, 16 Feb 2021 20:13:34 +0100
Subject: [PATCH] plot works now, /close #278

---
 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..6c993d56 100644
--- a/mlair/run_modules/training.py
+++ b/mlair/run_modules/training.py
@@ -223,7 +223,7 @@ class Training(RunEnvironment):
         if multiple_branches_used:
             filename = os.path.join(path, f"{name}_history_main_loss.pdf")
             PlotModelHistory(filename=filename, history=history, main_branch=True)
-        if "mean_squared_error" in history.model.metrics_names:
+        if len([e for e in history.model.metrics_names if "mean_squared_error" in e]) > 0:
             filename = os.path.join(path, f"{name}_history_main_mse.pdf")
             PlotModelHistory(filename=filename, history=history, plot_metric="mse", main_branch=multiple_branches_used)
 
-- 
GitLab