MILVLG / bottom-up-attention.pytorch

A PyTorch reimplementation of bottom-up-attention models
Apache License 2.0
294 stars 76 forks source link

TypeError: __init__() got an unexpected keyword argument 'first_stride' #96

Closed Yevet closed 2 years ago

Yevet commented 2 years ago

If I use any caffe model to run visualize.py, it will report: TypeError: init() got an unexpected keyword argument 'first_stride'

Yevet commented 2 years ago

Traceback (most recent call last): File "F:/object detect/bottom-up/bottom-up-attention.pytorch/utils/visualize.py", line 84, in model = DefaultTrainer.build_model(cfg) File "f:\detectron2\detectron2-master\detectron2\engine\defaults.py", line 504, in build_model model = build_model(cfg) File "f:\detectron2\detectron2-master\detectron2\modeling\meta_arch\build.py", line 22, in build_model model = META_ARCH_REGISTRY.get(meta_arch)(cfg) File "F:\object detect\bottom-up\bottom-up-attention.pytorch\bua\caffe\modeling\rcnn.py", line 37, in init self.backbone = build_backbone(cfg) File "f:\detectron2\detectron2-master\detectron2\modeling\backbone\build.py", line 31, in build_backbone backbone = BACKBONE_REGISTRY.get(backbone_name)(cfg, input_shape) File "F:\object detect\bottom-up\bottom-up-attention.pytorch\bua\caffe\modeling\backbone.py", line 157, in build_bua_resnet_backbone blocks = make_stage(*stage_kargs) File "f:\detectron2\detectron2-master\detectron2\modeling\backbone\resnet.py", line 611, in make_stage return ResNet.make_stage(args, kwargs) File "f:\detectron2\detectron2-master\detectron2\modeling\backbone\resnet.py", line 542, in make_stage block_class(in_channels=in_channels, out_channels=out_channels, curr_kwargs) TypeError: init() got an unexpected keyword argument 'first_stride'

Process finished with exit code 1

Yevet commented 2 years ago

When I apply a d2 model, it report: Traceback (most recent call last): File "F:/object detect/bottom-up/bottom-up-attention.pytorch/utils/visualize.py", line 84, in model = DefaultTrainer.build_model(cfg) File "f:\detectron2\detectron2-master\detectron2\engine\defaults.py", line 504, in build_model model = build_model(cfg) File "f:\detectron2\detectron2-master\detectron2\modeling\meta_arch\build.py", line 22, in build_model model = META_ARCH_REGISTRY.get(meta_arch)(cfg) File "f:\detectron2\detectron2-master\detectron2\config\config.py", line 189, in wrapped explicit_args = _get_args_from_config(from_config_func, *args, kwargs) File "f:\detectron2\detectron2-master\detectron2\config\config.py", line 245, in _get_args_from_config ret = from_config_func(*args, *kwargs) File "f:\detectron2\detectron2-master\detectron2\modeling\meta_arch\rcnn.py", line 76, in from_config "roi_heads": build_roi_heads(cfg, backbone.output_shape()), File "f:\detectron2\detectron2-master\detectron2\modeling\roi_heads\roi_heads.py", line 43, in build_roi_heads return ROI_HEADS_REGISTRY.get(name)(cfg, input_shape) File "F:\object detect\bottom-up\bottom-up-attention.pytorch\bua\d2\modeling\roi_heads.py", line 131, in init super(Res5ROIHeads, self).init(cfg) # d2 0.2.1 File "f:\detectron2\detectron2-master\detectron2\config\config.py", line 189, in wrapped explicit_args = _get_args_from_config(from_config_func, args, kwargs) File "f:\detectron2\detectron2-master\detectron2\config\config.py", line 245, in _get_args_from_config ret = from_config_func(*args, **kwargs) TypeError: from_config() missing 1 required positional argument: 'input_shape'

Yevet commented 2 years ago

Detectron2 version should be 0.2.1

Abhayy-Kumar commented 6 months ago

Detectron2 version should be 0.2.1

can it be 0.2?