Repeated .fit() calls ignore max_steps iteration bound #4809
Labels
bug
Something isn't working
good first issue
Good for newcomers
help wanted
Open to be worked on
priority: 1
Medium priority task
🐛 Bug
Hello!
While trying to convert my code to PL (I'm starting to become a big fan!) I came across some unexpected behavior: In an iteration-based training setup repeated calls of
trainer.fit()
result in ignoring the iteration bound set by themax_steps
argument. The trainer will finish the entire epoch, even though in my opinion it shouldn't (forgive me if I missed something obvious, which is easily possible since I'm new to PL).Please reproduce using the BoringModel and post here
https://colab.research.google.com/drive/1gKLNoYXjW7s3ifSJJ00SVZi4b08GDy5F?usp=sharing
To Reproduce
In the BoringModel, I only changed the test cell to something like this:
Expected behavior
I expect repeated
trainer.fit()
calls to result in eithertrainer.global_step == trainer.max_steps
or
max_steps
iterationsI think most people would expect the former.
Environment
Additional context
The same problem arises if a fully trained model is loaded, and then
trainer.fit()
is called. This is especially troubling when atrainer.test()
follows.The text was updated successfully, but these errors were encountered: