-
Notifications
You must be signed in to change notification settings - Fork 1.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
add more detail of warning in basemodule #899
Conversation
Codecov Report
@@ Coverage Diff @@
## master #899 +/- ##
=======================================
Coverage 66.58% 66.58%
=======================================
Files 145 145
Lines 8828 8841 +13
Branches 1605 1606 +1
=======================================
+ Hits 5878 5887 +9
- Misses 2633 2637 +4
Partials 317 317
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
warnings.warn('This module has bee initialized, \ | ||
please call initialize(module, init_cfg) to reinitialize it') | ||
warnings.warn(f'init_weight of {self.__class__.__name__} has ' | ||
f'been called more than once.') |
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.
Agree, but "please call initialize(module, init_cfg) to reinitialize it" should be kept to give a tip for users what they could do.
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.
Actually, I am confused about why we should reinitialize it?
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.
It should not be initialized again, so I leave a warning as a reminder.
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.
What does please call initialize(module, init_cfg) to reinitialize it
mean?
Add the class name of the module to the warning in
init_weight
of BaseModule.