-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Enhance ShufflenetV2 #892
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
Enhance ShufflenetV2 #892
Conversation
e3b6a7c
to
d91e35f
Compare
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.
torchvision/models/shufflenetv2.py
Outdated
@@ -165,16 +161,16 @@ def shufflenetv2(pretrained=False, num_classes=1000, width_mult=1, **kwargs): | |||
|
|||
|
|||
def shufflenetv2_x0_5(pretrained=False, num_classes=1000, **kwargs): | |||
return shufflenetv2(pretrained, num_classes, 0.5) | |||
return _shufflenetv2(pretrained, num_classes, '0.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.
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 it would be nice to expose to the user paper's parameters, either by staticmethod, stand-alone function, or documentation.
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 don't know whether it would be better. @fmassa could guide you on this. But the above requested changes will make the implementation similar to that of ResNets.
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 that I prefer the approach that is followed by resnet
vision/torchvision/models/resnet.py
Line 256 in 0564df4
return _resnet('resnet101', Bottleneck, [3, 4, 23, 3], pretrained, progress, |
Paper parameters are specified in the functions (and defines the meaning of 0_5
/ 1_0
etc), but the base class should be agnostic to it if possible.
Codecov Report
@@ Coverage Diff @@
## master #892 +/- ##
=========================================
- Coverage 56.95% 56.7% -0.25%
=========================================
Files 43 43
Lines 3559 3562 +3
Branches 544 546 +2
=========================================
- Hits 2027 2020 -7
- Misses 1414 1420 +6
- Partials 118 122 +4
Continue to review full report at Codecov.
|
@fmassa sure. |
Class shufflenetv2 receives `stages_repeats` and `stages_out_channels` arguments.
d91e35f
to
69c3a1f
Compare
rebased. I didn't test it because |
@barrh for easy developing Python code which contains C++ extensions, I generally 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.
Thanks a lot!
Class shufflenetv2 receives
stages_repeats
andstages_out_channels
arguments.Following discussion in: #889