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

add more detail of warning in basemodule #899

Merged
merged 1 commit into from
Mar 29, 2021

Conversation

jshilong
Copy link
Collaborator

Add the class name of the module to the warning in init_weight of BaseModule.

@codecov
Copy link

codecov bot commented Mar 18, 2021

Codecov Report

Merging #899 (a918223) into master (73bff4e) will increase coverage by 0.00%.
The diff coverage is 68.75%.

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

@@           Coverage Diff           @@
##           master     #899   +/-   ##
=======================================
  Coverage   66.58%   66.58%           
=======================================
  Files         145      145           
  Lines        8828     8841   +13     
  Branches     1605     1606    +1     
=======================================
+ Hits         5878     5887    +9     
- Misses       2633     2637    +4     
  Partials      317      317           
Flag Coverage Δ
unittests 66.58% <68.75%> (+<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% <66.66%> (-6.31%) ⬇️
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 00870b9...0a7be2e. Read the comment docs.

warnings.warn('This module has bee initialized, \
please call initialize(module, init_cfg) to reinitialize it')
warnings.warn(f'init_weight of {self.__class__.__name__} has '
f'been called more than once.')
Copy link
Collaborator

Choose a reason for hiding this comment

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

Agree, but "please call initialize(module, init_cfg) to reinitialize it" should be kept to give a tip for users what they could do.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Actually, I am confused about why we should reinitialize it?

Copy link
Collaborator

Choose a reason for hiding this comment

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

It should not be initialized again, so I leave a warning as a reminder.

Copy link
Collaborator Author

@jshilong jshilong Mar 23, 2021

Choose a reason for hiding this comment

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

What does please call initialize(module, init_cfg) to reinitialize it mean?

@hellock hellock requested a review from MeowZheng March 20, 2021 14:57
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.

4 participants