-
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
Fix setup callback hook to pass LightningModule through #4608
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4608 +/- ##
=======================================
- Coverage 93% 93% -0%
=======================================
Files 117 117
Lines 8805 8914 +109
=======================================
+ Hits 8172 8273 +101
- Misses 633 641 +8 |
240f809
to
bbe255f
Compare
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.
Great catch !
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, just it seems to be API change for setup hook
@williamFalcon could you pls approve this API/hook change as part of bugfix release? |
* Fix setup callback hook * Update CHANGELOG.md * Update test_trainer.py * Update test_trainer.py * Update test_trainer.py * fix chlog Co-authored-by: Jirka Borovec <[email protected]>
* Fix setup callback hook * Update CHANGELOG.md * Update test_trainer.py * Update test_trainer.py * Update test_trainer.py * fix chlog Co-authored-by: Jirka Borovec <[email protected]>
What does this PR do?
As currently written, the
setup()
function in callbacks is passedmodel=None
sinceTrainer.model
is not yet set when the call toself.trainer.get_model()
is made. This PR explicitly passes model through to the callback instead of relying onself.trainer.get_model()
cc @kandluis
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 in short, see following bullet-list:
Did you have fun?
Make sure you had fun coding 🙃