Fix a logic flaw that causes checkpoints to be saved at wrong epochs.

This commit is contained in:
Peter-1213 2021-10-27 01:22:33 +08:00
parent 9b86d8c0b8
commit 9cf6c3824b

View file

@ -364,7 +364,7 @@ def _all_gather_predictions(predictions):
def save_checkpoint(args, trainer, epoch_itr, val_loss):
if epoch_itr.epoch % args.save_interval == 0:
if epoch_itr.epoch % args.save_interval != 0:
return
if args.no_save or not distributed_utils.is_master(args):
return