Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug comparing max_steps to global step which inits at 0 #4278

Merged
merged 10 commits into from
Oct 22, 2020
2 changes: 1 addition & 1 deletion pytorch_lightning/trainer/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ def train(self):
# run train epoch
self.train_loop.run_training_epoch()

if self.max_steps and self.max_steps <= self.global_step:
if self.max_steps and self.max_steps <= self.global_step + 1:
SeanNaren marked this conversation as resolved.
Show resolved Hide resolved

# hook
self.train_loop.on_train_end()
Expand Down