Skip to content

Commit

Permalink
Fill keys in CSVLogger before stop_training is checked (keras-team#8801)
Browse files Browse the repository at this point in the history
  • Loading branch information
novotnj3 authored and fchollet committed Dec 15, 2017
1 parent 0611d80 commit c45a2c7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions keras/callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -965,13 +965,14 @@ def handle_value(k):
else:
return k

if self.keys is None:
self.keys = sorted(logs.keys())

if self.model.stop_training:
# We set NA so that csv parsers do not fail for this last epoch.
logs = dict([(k, logs[k]) if k in logs else (k, 'NA') for k in self.keys])

if not self.writer:
self.keys = sorted(logs.keys())

class CustomDialect(csv.excel):
delimiter = self.sep

Expand Down

0 comments on commit c45a2c7

Please sign in to comment.