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 authored and PC91 committed Jan 7, 2024
1 parent a987e7d commit 0a06542
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 0a06542

Please sign in to comment.