-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Add on_exception callback hook #9183
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
Conversation
for more information, see https://pre-commit.ci
…ning into on_exception
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.
To keep the PRs single-focused, I'd recommend splitting this into:
- 1 PR to add the
on_exception
hook - 1 PR to deprecate
on_keyboard_interrupt
in favor ofon_exception
for more information, see https://pre-commit.ci
thanks for the review @ananthsub! I separated the PRs with daniellepintz#1 |
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.
please check the test failures. we'll need to add this hook to the Lambda Callback as well: https://github.com/PyTorchLightning/pytorch-lightning/blob/master/pytorch_lightning/callbacks/lambda_function.py
@ananthsub tests are fixed now! |
Codecov Report
@@ Coverage Diff @@
## master #9183 +/- ##
=======================================
- Coverage 92% 88% -4%
=======================================
Files 176 176
Lines 14877 14831 -46
=======================================
- Hits 13723 13064 -659
- Misses 1154 1767 +613 |
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 stuff!
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.
need clarification on deprecation other interrupt and better spec loop from which the exception is coming from
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 ! small question.
What does this PR do?
Create an
on_exception
callback hook that users can override to implement custom behavior when an exception occurs.Fixes #8992
Does your PR introduce any breaking changes? If yes, please list them.
Before submitting
PR review
Anyone in the community is welcome to review the PR.
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 🙃