Skip to content

Commit

Permalink
Fix error to load data at the correct position when resuming from a c…
Browse files Browse the repository at this point in the history
…heckpoint
  • Loading branch information
Thai Chau Truong committed Nov 19, 2023
1 parent fd2f145 commit cd4d637
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions onmt/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,10 @@ def train(
for i, (batches, normalization) in enumerate(self._accum_batches(train_iter)):

step = self.optim.training_step
# Check if the iterator is at the same step as the optimizer
if (i + 1 != step):
continue

# UPDATE DROPOUT
self._maybe_update_dropout(step)

Expand Down

0 comments on commit cd4d637

Please sign in to comment.