Commit 0020477a authored by Myle Ott's avatar Myle Ott Committed by Facebook Github Bot
Browse files

Don't reload best validation loss when using --reset-optimizer

Summary: Pull Request resolved: https://github.com/pytorch/fairseq/pull/661

Differential Revision: D15068312

Pulled By: myleott

fbshipit-source-id: 1216835fd4c7f83ea5e350bff83901c93ac57447
parent fa52d202
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -362,7 +362,7 @@ def load_checkpoint(args, trainer, epoch_itr):

            trainer.lr_step(epoch_itr.epoch)
            trainer.lr_step_update(trainer.get_num_updates())
            if 'best' in extra_state:
            if 'best' in extra_state and not args.reset_optimizer:
                save_checkpoint.best = extra_state['best']
        return True
    else: