hhaAndroid / mmdetection-mini

mmdetection最小学习版
MIT License
1.08k stars 194 forks source link

感受野计算出错 #25

Open zhaoxin111 opened 3 years ago

zhaoxin111 commented 3 years ago

您好,我尝试将您实现的感受野计算工具迁移至mmdetv2中去,但一直计算出错 尝试retinanet感受野计算,报以下错 Traceback (most recent call last): File "tools/receptive_analyze.py", line 45, in analyze_receptive(cfg, input_shape, index) File "tools/receptive_analyze.py", line 36, in analyze_receptive calc_receptive_filed(model, input_shape, index) File "/home/zhaoxin/workspace/mmdetection/tools/../mmdet/core/utils/receptivefield.py", line 103, in calc_receptive_filed cal_model.compute(input_shape, [index]) File "/home/zhaoxin/workspace/mmdetection/tools/../mmdet/core/utils/receptivefield.py", line 54, in compute replace_names_dict(self._model) File "/home/zhaoxin/workspace/mmdetection/tools/../mmdet/core/utils/misc.py", line 86, in replace_names_dict _get_names(model) File "/home/zhaoxin/workspace/mmdetection/tools/../mmdet/core/utils/misc.py", line 73, in _get_names _get_names(m, parent_name=name) File "/home/zhaoxin/workspace/mmdetection/tools/../mmdet/core/utils/misc.py", line 78, in _get_names module._modules[key] = Linear() NameError: name 'Linear' is not defined

尝试faster rcnn时,报以下错 Traceback (most recent call last): File "tools/receptive_analyze.py", line 45, in analyze_receptive(cfg, input_shape, index) File "tools/receptive_analyze.py", line 34, in analyze_receptive model = create_model(cfg) File "tools/receptive_analyze.py", line 29, in create_model model = build_detector(cfg.model, train_cfg=None, test_cfg=None) File "/home/zhaoxin/workspace/mmdetection/tools/../mmdet/models/builder.py", line 67, in build_detector return build(cfg, DETECTORS, dict(train_cfg=train_cfg, test_cfg=test_cfg)) File "/home/zhaoxin/workspace/mmdetection/tools/../mmdet/models/builder.py", line 32, in build return build_from_cfg(cfg, registry, default_args) File "/home/zhaoxin/workspace/mmcv/mmcv/utils/registry.py", line 171, in build_from_cfg return obj_cls(**args) File "/home/zhaoxin/workspace/mmdetection/tools/../mmdet/models/detectors/faster_rcnn.py", line 24, in init pretrained=pretrained) File "/home/zhaoxin/workspace/mmdetection/tools/../mmdet/models/detectors/two_stage.py", line 34, in init rpnhead.update(train_cfg=rpn_train_cfg, test_cfg=test_cfg.rpn) AttributeError: 'NoneType' object has no attribute 'rpn'

hhaAndroid commented 3 years ago

这应该有些问题,我后面自己测试并且迁移到mmdet吧,我现在也维护mmdet,弄起来耶方便