-
Notifications
You must be signed in to change notification settings - Fork 1.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
[Refactor]: Unified parameter initialization #622
Conversation
Need to resolve conflicts. FCOS3D seems to have low accuracy. |
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.
After this pr merging, please check the log carefully.
'please use "init_cfg" instead') | ||
self.init_cfg = dict(type='Pretrained', checkpoint=pretrained) | ||
else: | ||
self.init_cfg = dict(type='Kaiming', layer='Conv2d') |
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.
According to L66-67, why use Kaiming init here?
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.
if we dont use the pretrained model, we want to use kaiming_init to init all Conv2d layer.
self.init_cfg = dict( | ||
type='Kaiming', | ||
layer='Conv2d', | ||
override=dict(type='Kaiming', name='heatmap')) |
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 think override can be deleted, as you have init heatmap
in init_weights.
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.
Yes, I forget to delete it. thank you!
layer='Conv2d', | ||
override=dict( | ||
type='Kaiming', | ||
name=self.cls_head[-1], |
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.
the value of name
is attribute name. I suggest to rewrite init_weights
for initializing cls_head.
mmdet3d/__init__.py
Outdated
@@ -17,7 +17,7 @@ def digit_version(version_str): | |||
return digit_version | |||
|
|||
|
|||
mmcv_minimum_version = '1.3.1' | |||
mmcv_minimum_version = '1.3.5' |
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.
Should set 1.3.8
mmdet3d/__init__.py
Outdated
@@ -27,17 +27,17 @@ def digit_version(version_str): | |||
f'MMCV=={mmcv.__version__} is used but incompatible. ' \ | |||
f'Please install mmcv>={mmcv_minimum_version}, <={mmcv_maximum_version}.' | |||
|
|||
mmdet_minimum_version = '2.10.0' | |||
mmdet_maximum_version = '2.11.0' | |||
mmdet_minimum_version = '2.12.0' |
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.
Should be 2.14.0 then.
mmdet3d/__init__.py
Outdated
mmseg_minimum_version = '0.14.0' | ||
mmseg_maximum_version = '0.14.0' | ||
mmseg_minimum_version = '0.14.1' | ||
mmseg_maximum_version = '0.15.0' |
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.
may set 1.0.0 for now. Usually there is not many BC-breakings.
Codecov Report
@@ Coverage Diff @@
## master #622 +/- ##
==========================================
- Coverage 51.01% 48.80% -2.22%
==========================================
Files 204 208 +4
Lines 15383 15858 +475
Branches 2488 2542 +54
==========================================
- Hits 7848 7739 -109
- Misses 7017 7625 +608
+ Partials 518 494 -24
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
docs/compatibility.md
Outdated
@@ -4,6 +4,15 @@ This document provides detailed descriptions of the BC-breaking changes in MMDet | |||
|
|||
## MMDetection3D 0.15.0 | |||
|
|||
### Unified parameter initialization | |||
|
|||
To unify the parameter initialization in OpenMMLab projects, MMCV supports `BaseModule` that accepts `init_cfg` to allow the modules' parameters initialized in a flexible and unified manner. Now the users need to explicitly call `model.init_weights()` in the training script to initialize the model (as in [here](https://github.com/open-mmlab/mmdetection3d/blob/master/tools/train.py#L183), previously this was handled by the detector. Please refer to PR #378 for details. |
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.
Motivation
Refactoring model initialization methods based MMCV. For more information, please refer to open-mmlab/mmcv#780
Dependency
Training results