Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Commit

Permalink
Fix typo when loading train state (#2425)
Browse files Browse the repository at this point in the history
* Fix typo when loading train state

* Fix comment
  • Loading branch information
nelson-liu authored and joelgrus committed Jan 23, 2019
1 parent cb9651a commit b7d56ae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions allennlp/training/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -565,10 +565,10 @@ def _restore_checkpoint(self) -> int:
# Currently the ``training_state`` contains a serialized ``MetricTracker``.
if "metric_tracker" in training_state:
self._metric_tracker.load_state_dict(training_state["metric_tracker"])
# It used to be the case that we tracked ``val_metrics_per_epoch``.
# It used to be the case that we tracked ``val_metric_per_epoch``.
elif "val_metric_per_epoch" in training_state:
self._metric_tracker.clear()
self._metric_tracker.add_metrics(training_state["val_metrics_per_epoch"])
self._metric_tracker.add_metrics(training_state["val_metric_per_epoch"])
# And before that we didn't track anything.
else:
self._metric_tracker.clear()
Expand Down

0 comments on commit b7d56ae

Please sign in to comment.