From f738b611a81166ffab3d19254a51f350da75cb64 Mon Sep 17 00:00:00 2001 From: Wei Ji <23487320+weiji14@users.noreply.github.com> Date: Fri, 2 Feb 2018 15:50:34 +1300 Subject: [PATCH] Quickfix flat loss plots for model.fit_generator() Append a shallow copy of the 'logs' variable instead of the 'logs' variable itself. Fixes issue of flat plots when using keras model.fit_generator(). --- live_loss_plot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/live_loss_plot.py b/live_loss_plot.py index 406a067..1756169 100644 --- a/live_loss_plot.py +++ b/live_loss_plot.py @@ -24,7 +24,7 @@ def on_train_begin(self, logs={}): self.logs = [] def on_epoch_end(self, epoch, logs={}): - self.logs.append(logs) + self.logs.append(logs.copy()) clear_output(wait=True) plt.figure(figsize=self.figsize)