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

[Bug] flops get wrong :'BatchNorm2d' object has no attribute '__flops__' #9451

Open
3 tasks done
jimuIee opened this issue Dec 6, 2022 · 2 comments
Open
3 tasks done
Assignees

Comments

@jimuIee
Copy link

jimuIee commented Dec 6, 2022

Prerequisite

Task

I'm using the official example scripts/configs for the officially supported tasks/models/datasets.

Branch

master branch https://github.com/open-mmlab/mmdetection

Environment

mmcls 0.23.2
mmcv-full 1.5.0
mmdet 2.25.1 anaconda3/envs/openmmlab/lib/python3.8/site-packages/mmdet-2.25.1-py3.8.egg
model-index 0.1.11
nest-asyncio 1.5.5
networkx 2.8.7

Reproduces the problem - code sample

self.bn = nn.BatchNorm2d(channels)
i have add a new class in fpn.py and this new class hac include nn.BatchNorm2d

Reproduces the problem - command or script

python tools/analysis_tools/get_flops.py work_dirs/gfl_r50_fpn_1x_coco_res101/gfl_r50_fpn_1x_coco.py

Reproduces the problem - error message

'BatchNorm2d' object has no attribute 'flops'

Additional information

No response

@hhaAndroid
Copy link
Collaborator

@jimuIee Can you check if the official configuration provided is working? For example python tools/analysis_tools/get_flops.py configs/gfl/gfl_r50_fpn_1x_coco.py

@jimuIee
Copy link
Author

jimuIee commented Dec 12, 2022

@jimuIee Can you check if the official configuration provided is working? For example python tools/analysis_tools/get_flops.py configs/gfl/gfl_r50_fpn_1x_coco.py

YES the official config can working normally,but why did i add a "nn.batchnorm2d"made it fail?

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

No branches or pull requests

2 participants