-
Notifications
You must be signed in to change notification settings - Fork 22.1k
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
Better error messaging for requiring ModuleList to be constant #13899
Comments
Thanks for the feedback! We will look to improve our error messaging in the next release. This issue has been added to our internal triage. |
My code (follows) appends to ModuleList, therefore when I declare ModuleList as constant, I get the error:
Is there a work arround for this? `class resblock(ScriptModule):
|
You need to append the resnet blocks into an array and then initialize the module_list For example m = [] |
#17167 suggests add to |
🚀 Feature
The fix in the above case is to declare
__constants__ = ["conv_lstms"]
So the error message should say that
ModuleList
should be declared constantMotivation
The error message is very unclear for new users.
The text was updated successfully, but these errors were encountered: