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 3c4b7b7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion onmt/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,11 @@ def train(
torch.cuda.empty_cache()

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 3c4b7b7

Please sign in to comment.