mmdetection
mmdetection copied to clipboard
[Bug] flops get wrong :'BatchNorm2d' object has no attribute '__flops__'
Prerequisite
- [X] I have searched Issues and Discussions but cannot get the expected help.
- [X] I have read the FAQ documentation but cannot get the expected help.
- [X] The bug has not been fixed in the latest version (master) or latest version (3.x).
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
@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 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?