-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Load ckpt path when model provided in validate/test/predict #8352
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SeanNaren
changed the title
Change trainer loading behaviour for validate/test/predict
Change ckpt_path loading behaviour for validate/test/predict
Jul 9, 2021
SeanNaren
changed the title
Change ckpt_path loading behaviour for validate/test/predict
Change ckpt_path behaviour for validate/test/predict
Jul 9, 2021
Codecov Report
@@ Coverage Diff @@
## master #8352 +/- ##
======================================
Coverage 92% 92%
======================================
Files 218 218
Lines 14398 14407 +9
======================================
+ Hits 13296 13305 +9
Misses 1102 1102 |
SeanNaren
commented
Jul 12, 2021
SeanNaren
changed the title
Change ckpt_path behaviour for validate/test/predict
Load ckpt path when model provided in validate/test/predict
Jul 12, 2021
SeanNaren
requested review from
awaelchli,
Borda,
carmocca,
justusschock,
kaushikb11,
tchaton and
williamFalcon
as code owners
July 12, 2021 09:35
SeanNaren
commented
Jul 12, 2021
tchaton
approved these changes
Jul 12, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM !
carmocca
reviewed
Jul 12, 2021
SeanNaren
added
breaking change
Includes a breaking change
checkpointing
Related to checkpointing
labels
Jul 12, 2021
12 tasks
carmocca
reviewed
Jul 13, 2021
mergify
bot
added
ready
PRs ready to be merged
has conflicts
and removed
has conflicts
labels
Jul 27, 2021
leezu
pushed a commit
to leezu/pytorch-lightning
that referenced
this pull request
Sep 30, 2021
…g-AI#8352) * Change trainer loading behaviour for validate/test/predict * Fix * Fix/add tests * remove * Cleanups * Space * cleanups * Add CHANGELOG.md * Move after setup * Cleanups on logic * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Remve * fix test * feedback * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update pytorch_lightning/trainer/properties.py Co-authored-by: Carlos Mocholí <[email protected]> * Feedback * Same fix * Same fix * Add test for behaviour, modify based on feedback * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Wording * Apply suggestions from code review Co-authored-by: Kaushik B <[email protected]> Co-authored-by: Carlos Mocholí <[email protected]> * Cleanup docs * Update pytorch_lightning/trainer/trainer.py Co-authored-by: Kaushik B <[email protected]> * feedback * Fixes to test API * Add carlos description * Move logic further * Move checkpoint connector logic Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Carlos Mocholí <[email protected]> Co-authored-by: Kaushik B <[email protected]>
12 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
breaking change
Includes a breaking change
checkpointing
Related to checkpointing
feature
Is an improvement or enhancement
ready
PRs ready to be merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Closes #8347
Behaviour now is for test, validate and predict:
The biggest change is that if anyone did
trainer.test(ckpt_path=None)
to load the latest model, they would now need to change this totrainer.test(model)
and pass the model reference directly (same forvalidate/predict
).Before submitting
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:
Did you have fun?
Make sure you had fun coding 🙃