Skip to content
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 bug of convmodule #889

Merged
merged 4 commits into from
Mar 20, 2021
Merged

fix bug of convmodule #889

merged 4 commits into from
Mar 20, 2021

Conversation

jshilong
Copy link
Collaborator

@jshilong jshilong commented Mar 15, 2021

This PR fixes the potential bug of ConvModule when specifying the norm_cfg as None.
The original implementation would raise the ConvModule' object has no attribute 'norm when you try to call
self.norm when passing norm_cfg as None.

I believe the original design is not reasonable, because you can find an attribute named norm by dir(instance) or instance.__dict__, but when you access it by instance.norm, it will raise an error.

Closes #871

@ZwwWayne ZwwWayne requested a review from nbei March 16, 2021 04:59
@codecov
Copy link

codecov bot commented Mar 16, 2021

Codecov Report

Merging #889 (d7c4958) into master (73bff4e) will increase coverage by 0.01%.
The diff coverage is 77.77%.

❗ Current head d7c4958 differs from pull request most recent head d1ed0fc. Consider uploading reports for the commit d1ed0fc to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master     #889      +/-   ##
==========================================
+ Coverage   66.58%   66.59%   +0.01%     
==========================================
  Files         145      145              
  Lines        8828     8844      +16     
  Branches     1605     1607       +2     
==========================================
+ Hits         5878     5890      +12     
- Misses       2633     2637       +4     
  Partials      317      317              
Flag Coverage Δ
unittests 66.59% <77.77%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
mmcv/runner/base_module.py 79.41% <69.23%> (-6.31%) ⬇️
mmcv/cnn/bricks/conv_module.py 100.00% <100.00%> (ø)
mmcv/runner/__init__.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 73bff4e...d1ed0fc. Read the comment docs.

Copy link
Contributor

@nbei nbei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

mmcv/cnn/bricks/conv_module.py Outdated Show resolved Hide resolved
@jshilong jshilong requested a review from nbei March 18, 2021 06:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

'ConvModule' object has no attribute 'norm' when using torch.jit.trace
3 participants