Skip to content

Commit

Permalink
fixed issue where callback_metrics was replaced instead of updated (#492
Browse files Browse the repository at this point in the history
)
  • Loading branch information
ryanwongsa authored and williamFalcon committed Nov 12, 2019
1 parent e350a7d commit ba0a32c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pytorch_lightning/trainer/evaluation_loop_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def run_evaluation(self, test=False):
self.log_metrics(log_metrics, {})

# track metrics for callbacks
self.callback_metrics = callback_metrics
self.callback_metrics.update(callback_metrics)

# hook
model.on_post_performance_check()
Expand Down
2 changes: 1 addition & 1 deletion pytorch_lightning/trainer/train_loop_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ def optimizer_closure():
all_log_metrics = {k: v for d in all_log_metrics for k, v in d.items()}

# track all metrics for callbacks
self.callback_metrics = {k: v for d in all_callback_metrics for k, v in d.items()}
self.callback_metrics.update({k: v for d in all_callback_metrics for k, v in d.items()})

return 0, grad_norm_dic, all_log_metrics

Expand Down

0 comments on commit ba0a32c

Please sign in to comment.