Fixed a bug in fairseq training loop where valid_losses is not evaluated before reference
Summary:
It is possible that valid_losses is not evaluated in train.py. Here is a fix.
# Facebook:
see for an example.
@@ -215,9 +215,8 @@ def train(args, trainer, task, epoch_itr):
"train_step-%d" % i
):
log_output = trainer.train_step(samples)
- if log_output is None: # OOM, overflow, ...
- continue
+ if log_output is not None: # not OOM, overflow, ...
# log mid-epoch stats
num_updates = trainer.get_num_updates()
if num_updates % args.log_interval == 0:
