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

change default save_top_k, save_last to None #3680

Merged
merged 20 commits into from
Sep 28, 2020

Conversation

awaelchli
Copy link
Contributor

@awaelchli awaelchli commented Sep 27, 2020

What does this PR do?

We broke save_top_k when monitor default was switched to None.
save_top_k only makes sense when we have a metric to monitor.
The only exception is when save_top_k=-1, we want to save all checkpoints of all epochs. This PR re-enables it!

Before submitting

  • Was this discussed/approved via a Github issue? (no need for typos and docs improvements)
  • 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? Otherwise, we ask you to create a separate PR for every change.
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests?
  • Did you verify new and existing tests pass locally with your changes?
  • If you made a notable change (that affects users), did you update the CHANGELOG?

PR review

Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.

Did you have fun?

Make sure you had fun coding 🙃

@awaelchli awaelchli mentioned this pull request Sep 27, 2020
7 tasks
@pep8speaks
Copy link

pep8speaks commented Sep 27, 2020

Hello @awaelchli! Thanks for updating this PR.

Line 248:13: W503 line break before binary operator
Line 249:13: W503 line break before binary operator
Line 250:13: W503 line break before binary operator
Line 251:13: W503 line break before binary operator

Comment last updated at 2020-09-27 23:11:12 UTC

@codecov
Copy link

codecov bot commented Sep 27, 2020

Codecov Report

Merging #3680 into master will decrease coverage by 0%.
The diff coverage is 100%.

@@          Coverage Diff           @@
##           master   #3680   +/-   ##
======================================
- Coverage      86%     86%   -0%     
======================================
  Files         110     110           
  Lines        8112    8059   -53     
======================================
- Hits         6957    6898   -59     
- Misses       1155    1161    +6     

@awaelchli awaelchli changed the title change default save_top_k to None change default save_top_k, save_last to None Sep 27, 2020
@awaelchli awaelchli marked this pull request as ready for review September 27, 2020 22:08
@mergify mergify bot requested a review from a team September 27, 2020 22:08
assert checkpoint_callback.best_k_models == {}
assert checkpoint_callback.kth_best_model_path == ''
# check that no ckpts were created
assert len(set(os.listdir(tmpdir))) == 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't need the set here, extra from the copy/paste

@awaelchli awaelchli added bug Something isn't working priority: 0 High priority task labels Sep 27, 2020
@carmocca
Copy link
Contributor

LGTM

@williamFalcon
Copy link
Contributor

nice job @awaelchli !

@williamFalcon williamFalcon merged commit d15fd75 into master Sep 28, 2020
@awaelchli awaelchli deleted the bugfix/savetopkdefault branch September 28, 2020 00:51
@Borda Borda added this to the 0.9.x milestone Sep 28, 2020
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: 0 High priority task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants