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

lr_tuner fails if called after tuning batch_size #4616

Closed
Palzer opened this issue Nov 11, 2020 · 6 comments · Fixed by #4688
Closed

lr_tuner fails if called after tuning batch_size #4616

Palzer opened this issue Nov 11, 2020 · 6 comments · Fixed by #4688
Labels
bug Something isn't working priority: 1 Medium priority task tuner
Milestone

Comments

@Palzer
Copy link
Contributor

Palzer commented Nov 11, 2020

https://github.com/PyTorchLightning/pytorch-lightning/blob/514cb22bd719e6ca056cacce730c8de875c9dbf6/pytorch_lightning/tuner/lr_finder.py#L411

The line above sets current_step to 2 if the batch_size tuner has already run.

https://github.com/PyTorchLightning/pytorch-lightning/blob/514cb22bd719e6ca056cacce730c8de875c9dbf6/pytorch_lightning/tuner/lr_finder.py#L419-L420

This causes best_loss to be zero and compare against the smoothed loss. This will cause the tuner to terminate and fail.

Also, just looks like this was already supposed to be changed.

@github-actions
Copy link
Contributor

Hi! thanks for your contribution!, great first issue!

@tchaton tchaton added tuner priority: 1 Medium priority task labels Nov 11, 2020
@tchaton tchaton added this to the 1.0.6 milestone Nov 11, 2020
@Borda Borda modified the milestones: 1.0.6, 1.0.x Nov 11, 2020
@edenlightning edenlightning added the bug Something isn't working label Nov 13, 2020
@edenlightning edenlightning removed this from the 1.0.x milestone Nov 13, 2020
@edenlightning
Copy link
Contributor

@SkafteNicki mind taking a look?

@SkafteNicki
Copy link
Member

It seems the solution is to remove the +1 from current_step (as the todo note also states)
@Palzer would you be up for sending a PR with the fix?

@Palzer
Copy link
Contributor Author

Palzer commented Nov 15, 2020

Done. First pr on github so be gentle :P

edit: checking out failures on pr

@SkafteNicki
Copy link
Member

@Palzer I can probably find some time tomorrow to look over your work. Thanks for wanting to contribute :]

@stale
Copy link

stale bot commented Dec 15, 2020

This issue has been automatically marked as stale because it hasn't had any recent activity. This issue will be closed in 7 days if no further activity occurs. Thank you for your contributions, Pytorch Lightning Team!

@stale stale bot added the won't fix This will not be worked on label Dec 15, 2020
@Borda Borda added this to the 1.1.x milestone Dec 21, 2020
@stale stale bot removed the won't fix This will not be worked on label Dec 21, 2020
@Borda Borda modified the milestones: 1.1.x, 1.2 Feb 8, 2021
@edenlightning edenlightning modified the milestones: 1.2, 1.2.x Feb 8, 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 priority: 1 Medium priority task tuner
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants