-
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
[Fix] Restrict the warning message #1267
Conversation
hi @yyz561 , please sign the CLA |
hi, please fix the CI |
Soryy, didn't noticed that code too long, will fix it immediately. |
It seems that the password is not valid for git push since yesterday. It took me some time to solve the problem, sorry for the delay. It should work now. |
yet, thanks for your contribution |
we also need to add a unittest |
will this work? I didn't
Sorry mate, my first time to write a unit test, will this work? |
I think it will work |
I am exhausted by the format issue... both here and in another PR, could you please name a few external tools I can use? Thanks a lot. |
hi, you can refer to https://github.com/open-mmlab/mmcv/blob/master/CONTRIBUTING.md. |
… and flake8, sigh...
Codecov Report
@@ Coverage Diff @@
## master #1267 +/- ##
==========================================
+ Coverage 68.23% 68.28% +0.05%
==========================================
Files 160 161 +1
Lines 10722 10744 +22
Branches 1969 1973 +4
==========================================
+ Hits 7316 7337 +21
- Misses 3022 3023 +1
Partials 384 384
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
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
hi @yyz561 , after reading the GN formula, I found the bias of conv also has no effect for the output of GN |
Hey, I didn't read the actual coding, but it is easy to do a GN experience. Try the following code:
for comparison:
|
Hey @zhouzaida, I wrote an blog to talk about the problem. At the same time, I realized that bias of conv also has no effect for the output of Instance Norm too. Could you please have a look at the blog? https://zhuanlan.zhihu.com/p/403444336 |
yet, you are right. Thanks for your patience |
@zhouzaida do you agree with me to change the warning message into: "Unnecessary conv bias before batch/instance norm" |
Agree |
"First-time contributors need a maintainer to approve running workflows." Thank you very much. Although it is a trivial change, I learned a lot through the process. |
Thanks for your contribution and we appreciate it a lot. The following instructions would make your pull request more healthy and more easily get feedback. If you do not understand some items, don't worry, just make the pull request and seek help from maintainers.
Motivation
When I implemented a CenterNet2 model in mmdet, there was a situation when I had to use GroupNorm after Conv2d, and the Conv2d layer was supposed to have a bias. Once I finished the modeling part, I got a warning message 'ConvModule has norm and bias at the same time'. At first, I was not so sure about this warning, it made me uneased. Then I did a little research and realized that for BatchNorm (not so sure about SyncBN), the bias does not affect the calculation. But for other kinds of Norm, e.g., GN, I am pretty sure the bias does give some influence. I think maybe we should restrict the popping of this warning message, since it can be quite misleading for new starters.
Modification
Restrict a warning message of 'ConvModule has norm and bias at the same time' to BN, BN1, BN2 and BN3 normalization.
BC-breaking (Optional)
Does the modification introduce changes that break the backward-compatibility of the downstream repos?
If so, please describe how it breaks the compatibility and how the downstream projects should modify their code to keep compatibility with this PR.
Use cases (Optional)
If this PR introduces a new feature, it is better to list some use cases here, and update the documentation.
Checklist