-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
Add in exceptions and verbose errors #3611
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Aware there's a small bug with the tests in there I think. Will get to it in the next few days |
@muellerzr can you take a look at this CI failure? Might just be a case of needing to merge lastest fastai changes - not sure. |
@jph00 okay, that was an exploration and a half but we got callbacks working. One thing I did have to do though was move up where the exception classes were defined so they can be pulled into |
except (CancelBatchException, CancelEpochException, CancelFitException, CancelStepException, CancelTrainException, CancelValidException): raise | ||
except Exception as e: |
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.
We could also rewrite this as something like:
except Exception as e:
if len(e.args) > 0:
e.args = [f'Exception occured in `{self.__class__.__name__}` when calling event `{event_name}`:\n\t{e.args[0]}']
raise
However that could potentially lead to trouble down the road. (I could also do a huge isinstance
too)
Thanks @muellerzr ! |
Includes a variety of verbose errors for commonly situated problems. Due to the complexity of some issues, some of the logic in said errors is a bit much in order to provide a clear picture of what went wrong (such as the
collate_error
).Open to removing any you're not comfortable with @jph00