-
Notifications
You must be signed in to change notification settings - Fork 7k
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
Standardize errors for when pre-trained weights are not available #5572
Conversation
💊 CI failures summary and remediationsAs of commit 394aa03 (more details on the Dr. CI page): 💚 💚 Looks good so far! There are no failures yet. 💚 💚 This comment was automatically generated by Dr. CI (expand for details).Please report bugs/suggestions to the (internal) Dr. CI Users group. |
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.
Thanks for the PR @datumbox . What is the logic for using a NotImplementedError here? At first sight it seems that ValueError may be more relevant. From the docs of the NotImplementedError exception:
It should not be used to indicate that an operator or method is not meant to be supported at all
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.
I left a bit but overall I'm aligned with Nicolas point that NotImplemented might not be the best candidate here
@NicolasHug I think you changed your opinion on this because this change was first proposed by you here: #5022 (comment) Personally I think throwing |
For the models modified in this PR, are we absolutely sure that we will implement the pretrained weights in the future (as it was the case in #5022 (comment)) ? If not, the Python docs explicitly recommend against using NotImplementedError. |
@NicolasHug Yes, there is nothing stopping us from providing these models on the future and nor I can think of a case were we offer a model builder but we absolutely don't want to offer weights. Also note that the models missing are on the list to be added and can be contributed by the community #2707 |
I believe we rely on ValueError much more often than on NotImplementedError in the current code-base for such scenarios. I won't fight against it but sorry, I prefer not to approve it. |
Our current implementation throws a
ValueError
if pre-trained weights are requested for an architecture that we don't offer checkpoints. In this PR we switch toNotImplementedError
exceptions and we standardize the error messages.