-
Notifications
You must be signed in to change notification settings - Fork 1.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
Update regnet.py #935
Update regnet.py #935
Conversation
In the example comment to print out the different layers of outputs, we need to indicate the `out_indices` to (0,1,2,3) to see all backbone layers output as the default argument is (3,)
Codecov Report
@@ Coverage Diff @@
## dev #935 +/- ##
==========================================
+ Coverage 84.57% 85.86% +1.29%
==========================================
Files 134 137 +3
Lines 8772 9363 +591
Branches 1516 1621 +105
==========================================
+ Hits 7419 8040 +621
+ Misses 1117 1082 -35
- Partials 236 241 +5
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it 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.
Thank you for your report.
It would be better if the case of str could be added, Can you please help us update it in this PR.
>>> from mmcls.models import RegNet
>>> import torch
>>> inputs = torch.rand(1, 3, 32, 32)
>>> # use str type 'arch'
>>> regnet_cfg = dict(arch='regnetx_4.0gf') # default out_indices is (3,)
>>> model = RegNet(**regnet_cfg)
>>> model.eval()
>>> level_outputs = model(inputs)
>>> for level_out in level_outputs:
... print(tuple(level_out.shape))
...
(1, 1360, 1, 1)
>>>
>>> # use dict type 'arch'
>>> arch_cfg =dict(w0=88, wa=26.31, wm=2.25, group_w=48, depth=25, bot_mul=1.0)
>>> regnet_cfg = dict(arch=arch_cfg, out_indices=(0, 1, 2, 3))
>>> model = RegNet(**regnet_cfg)
>>> model.eval()
>>> level_outputs = model(inputs)
>>> for level_out in level_outputs:
... print(tuple(level_out.shape))
...
(1, 96, 8, 8)
(1, 192, 4, 4)
(1, 432, 2, 2)
(1, 1008, 1, 1)
following changes proposal of maintainer
@Ezra-Yu follow your changes exactly. |
Please fix the lint error before merge. |
@mzr1996 done, sorry for the multiple useless commits, was not aware of the patch branch. You can see that the file changes is still just |
ping @Ezra-Yu , can close? |
We can finish the PR today. |
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.
LGTM.
docs is still off, I can't figure out how does the formatting works for now |
can you open this link |
thanks. |
* Update regnet.py In the example comment to print out the different layers of outputs, we need to indicate the `out_indices` to (0,1,2,3) to see all backbone layers output as the default argument is (3,) * Update regnet.py following changes proposal of maintainer * fix linting * fix blank space for docs * fix blank space for docs * fix blank space for docs
Motivation
In the example comment to print out the different layers of outputs, we need to indicate the
out_indices
to (0,1,2,3) to see all backbone layers output as the default argument is (3,).Let's just ensure that the user won't be confused on why the output printed does not match the code in the comments.
Modification
Just adding out_indices argument call to output all layers instead of leaving it to default.