-
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
[Features] Add initialization log #1128
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1128 +/- ##
==========================================
+ Coverage 67.64% 67.84% +0.19%
==========================================
Files 159 159
Lines 10295 10367 +72
Branches 1858 1873 +15
==========================================
+ Hits 6964 7033 +69
- Misses 2965 2966 +1
- Partials 366 368 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
LGTM, see if others have any comments. |
loggername = loggernames[0] if len(loggernames) > 0 else 'mmcv' | ||
print_log( | ||
f'initialize {modulename} with init_cfg {self.init_cfg}', | ||
logger=loggername) |
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.
L52
isinstance(self.init_cfg, (dict, ConfigDict)):
change to
isinstance(self.init_cfg, dict):
may be clearer
because ConfigDict
is subclass of dict
I believe all the keys should only appear once in the log, such as |
Can we maintain a |
continued in #1150 |
Motivation
To identify unnoticeable bug when weights initializing, I add initialization log to record this process.
Modification
print_log
ininit_weights
in mmcv/runner/base_module.py.init_log
function in mmcv/cnn/utils/weight_init.py.init_log
in Initializers in mmcv/cnn/utils/weight_init.py.print_log
in_initialize_override
in mmcv/cnn/utils/weight_init.py.Use cases
Developers can check whether models' parameters have been initialized as the way they set in
init_cfg
.Below is the log msg of RetinaNet initialization.