Skip to content

Conversation

@awaelchli
Copy link
Contributor

@awaelchli awaelchli commented Mar 6, 2021

What does this PR do?

When calling Trainer.fit multiple times there is a bug where in the second fit the optimization would use the
lightning optimizers from the first model because it is still hanging on to the old list.

The fix is to reset the list when new optimizers are requested from the model.
This way the lightning optimizers get re-wrapped when the training loop starts.

Fixes #6285

Before submitting

  • Was this discussed/approved via a GitHub issue? (not for typos and docs)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure your PR does only one thing, instead of bundling different changes together?
  • Did you make sure to update the documentation with your changes? (if necessary)
  • Did you write any new necessary tests? (not for typos and docs)
  • Did you verify new and existing tests pass locally with your changes?
  • Did you update the CHANGELOG? (not for typos, docs, test updates, or internal minor changes/refactorings)

PR review

Anyone in the community is free to review the PR once the tests have passed.
Before you start reviewing make sure you have read Review guidelines. In short, see the following bullet-list:

  • Is this pull request ready for review? (if not, please submit in draft mode)
  • Check that all items from Before submitting are resolved
  • Make sure the title is self-explanatory and the description concisely explains the PR
  • Add labels and milestones (and optionally projects) to the PR so it can be classified

Did you have fun?

Make sure you had fun coding 🙃

@awaelchli awaelchli added the bug Something isn't working label Mar 6, 2021
@awaelchli awaelchli added this to the 1.2.x milestone Mar 6, 2021
@pep8speaks
Copy link

pep8speaks commented Mar 6, 2021

Hello @awaelchli! Thanks for updating this PR.

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2021-03-06 17:27:02 UTC

@codecov
Copy link

codecov bot commented Mar 6, 2021

Codecov Report

Merging #6372 (a16a75b) into master (4f391bc) will decrease coverage by 2%.
The diff coverage is 92%.

@@           Coverage Diff           @@
##           master   #6372    +/-   ##
=======================================
- Coverage      93%     92%    -2%     
=======================================
  Files         161     161            
  Lines       11464   11476    +12     
=======================================
- Hits        10706   10513   -193     
- Misses        758     963   +205     

@carmocca carmocca added the ready PRs ready to be merged label Mar 6, 2021
@carmocca carmocca enabled auto-merge (squash) March 6, 2021 17:27
@carmocca carmocca merged commit 718074b into master Mar 8, 2021
@carmocca carmocca deleted the bugfix/lr_find branch March 8, 2021 01:58
@tchaton tchaton mentioned this pull request Mar 8, 2021
tchaton pushed a commit that referenced this pull request Mar 9, 2021
Borda pushed a commit that referenced this pull request Mar 9, 2021
tchaton pushed a commit that referenced this pull request Mar 9, 2021
lexierule pushed a commit that referenced this pull request Mar 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working ready PRs ready to be merged tuner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Optimizers are broken with auto_lr_find=True since 1.1.4

5 participants