Commit fe54ea54 authored by alexeib's avatar alexeib Committed by Myle Ott
Browse files

fix optim history

parent b84070b7
......@@ -61,8 +61,9 @@ class Trainer(object):
def save_checkpoint(self, filename, extra_state):
"""Save all training state in a checkpoint file."""
if distributed_utils.is_master(self.args): # only save one checkpoint
optim_history = self._optim_history if hasattr(self, '_optim_history') else None
utils.save_state(filename, self.args, self.model, self.criterion, self.optimizer,
self.lr_scheduler, self._num_updates, self._optim_history, extra_state)
self.lr_scheduler, self._num_updates, optim_history, extra_state)
def load_checkpoint(self, filename):
"""Load all training state from a checkpoint file."""
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment