Skip to content

RuntimeError: nms is not compiled with GPU support (nms at mmdet/ops/nms/src/nms_ext.cpp:23) #4

@QY1994-0919

Description

@QY1994-0919

Hello, I got this kind of error in the test demo.py

The model and loaded state dict do not match exactly

unexpected key in source state_dict: bbox_roi_extractor.roi_layers.0.awp.weight.conv.weight, bbox_roi_extractor.roi_layers.0.awp.weight.bn.weight, bbox_roi_extractor.roi_layers.0.awp.weight.bn.bias, bbox_roi_extractor.roi_layers.0.offset_fc.0.weight, bbox_roi_extractor.roi_layers.0.offset_fc.0.bias, bbox_roi_extractor.roi_layers.0.offset_fc.2.weight, bbox_roi_extractor.roi_layers.0.offset_fc.2.bias, bbox_roi_extractor.roi_layers.0.offset_fc.4.weight, bbox_roi_extractor.roi_layers.0.offset_fc.4.bias, bbox_roi_extractor.roi_layers.1.awp.weight.conv.weight, bbox_roi_extractor.roi_layers.1.awp.weight.bn.weight, bbox_roi_extractor.roi_layers.1.awp.weight.bn.bias, bbox_roi_extractor.roi_layers.1.offset_fc.0.weight, bbox_roi_extractor.roi_layers.1.offset_fc.0.bias, bbox_roi_extractor.roi_layers.1.offset_fc.2.weight, bbox_roi_extractor.roi_layers.1.offset_fc.2.bias, bbox_roi_extractor.roi_layers.1.offset_fc.4.weight, bbox_roi_extractor.roi_layers.1.offset_fc.4.bias, bbox_roi_extractor.roi_layers.2.awp.weight.conv.weight, bbox_roi_extractor.roi_layers.2.awp.weight.bn.weight, bbox_roi_extractor.roi_layers.2.awp.weight.bn.bias, bbox_roi_extractor.roi_layers.2.offset_fc.0.weight, bbox_roi_extractor.roi_layers.2.offset_fc.0.bias, bbox_roi_extractor.roi_layers.2.offset_fc.2.weight, bbox_roi_extractor.roi_layers.2.offset_fc.2.bias, bbox_roi_extractor.roi_layers.2.offset_fc.4.weight, bbox_roi_extractor.roi_layers.2.offset_fc.4.bias, bbox_roi_extractor.roi_layers.3.awp.weight.conv.weight, bbox_roi_extractor.roi_layers.3.awp.weight.bn.weight, bbox_roi_extractor.roi_layers.3.awp.weight.bn.bias, bbox_roi_extractor.roi_layers.3.offset_fc.0.weight, bbox_roi_extractor.roi_layers.3.offset_fc.0.bias, bbox_roi_extractor.roi_layers.3.offset_fc.2.weight, bbox_roi_extractor.roi_layers.3.offset_fc.2.bias, bbox_roi_extractor.roi_layers.3.offset_fc.4.weight, bbox_roi_extractor.roi_layers.3.offset_fc.4.bias, bbox_head.fc_cls.weight, bbox_head.fc_cls.bias, bbox_head.shared_fcs.0.weight, bbox_head.shared_fcs.0.bias, bbox_head.shared_fcs.1.weight, bbox_head.shared_fcs.1.bias, D2Det_head.convs.0.conv.weight, D2Det_head.convs.0.gn.weight, D2Det_head.convs.0.gn.bias, D2Det_head.convs.1.conv.weight, D2Det_head.convs.1.gn.weight, D2Det_head.convs.1.gn.bias, D2Det_head.convs.2.conv.weight, D2Det_head.convs.2.gn.weight, D2Det_head.convs.2.gn.bias, D2Det_head.convs.3.conv.weight, D2Det_head.convs.3.gn.weight, D2Det_head.convs.3.gn.bias, D2Det_head.convs.4.conv.weight, D2Det_head.convs.4.gn.weight, D2Det_head.convs.4.gn.bias, D2Det_head.convs.5.conv.weight, D2Det_head.convs.5.gn.weight, D2Det_head.convs.5.gn.bias, D2Det_head.convs.6.conv.weight, D2Det_head.convs.6.gn.weight, D2Det_head.convs.6.gn.bias, D2Det_head.convs.7.conv.weight, D2Det_head.convs.7.gn.weight, D2Det_head.convs.7.gn.bias, D2Det_head.D2Det_reg.weight, D2Det_head.D2Det_reg.bias, D2Det_head.D2Det_mask.weight, D2Det_head.D2Det_mask.bias, D2Det_head.deconv1.weight, D2Det_head.deconv1.bias, D2Det_head.norm1.weight, D2Det_head.norm1.bias, D2Det_head.deconv2.weight, D2Det_head.deconv2.bias, D2Det_head.D2Det_instance.weight, D2Det_head.D2Det_instance.bias, D2Det_head.fcs.0.weight, D2Det_head.fcs.0.bias, D2Det_head.fcs.1.weight, D2Det_head.fcs.1.bias, D2Det_head.fc_instance_iou.weight, D2Det_head.fc_instance_iou.bias

missing keys in source state_dict: roi_head.bbox_roi_extractor.roi_layers.0.awp.weight.conv.weight, roi_head.bbox_roi_extractor.roi_layers.0.awp.weight.bn.weight, roi_head.bbox_roi_extractor.roi_layers.0.awp.weight.bn.bias, roi_head.bbox_roi_extractor.roi_layers.0.offset_fc.0.weight, roi_head.bbox_roi_extractor.roi_layers.0.offset_fc.0.bias, roi_head.bbox_roi_extractor.roi_layers.0.offset_fc.2.weight, roi_head.bbox_roi_extractor.roi_layers.0.offset_fc.2.bias, roi_head.bbox_roi_extractor.roi_layers.0.offset_fc.4.weight, roi_head.bbox_roi_extractor.roi_layers.0.offset_fc.4.bias, roi_head.bbox_roi_extractor.roi_layers.1.awp.weight.conv.weight, roi_head.bbox_roi_extractor.roi_layers.1.awp.weight.bn.weight, roi_head.bbox_roi_extractor.roi_layers.1.awp.weight.bn.bias, roi_head.bbox_roi_extractor.roi_layers.1.offset_fc.0.weight, roi_head.bbox_roi_extractor.roi_layers.1.offset_fc.0.bias, roi_head.bbox_roi_extractor.roi_layers.1.offset_fc.2.weight, roi_head.bbox_roi_extractor.roi_layers.1.offset_fc.2.bias, roi_head.bbox_roi_extractor.roi_layers.1.offset_fc.4.weight, roi_head.bbox_roi_extractor.roi_layers.1.offset_fc.4.bias, roi_head.bbox_roi_extractor.roi_layers.2.awp.weight.conv.weight, roi_head.bbox_roi_extractor.roi_layers.2.awp.weight.bn.weight, roi_head.bbox_roi_extractor.roi_layers.2.awp.weight.bn.bias, roi_head.bbox_roi_extractor.roi_layers.2.offset_fc.0.weight, roi_head.bbox_roi_extractor.roi_layers.2.offset_fc.0.bias, roi_head.bbox_roi_extractor.roi_layers.2.offset_fc.2.weight, roi_head.bbox_roi_extractor.roi_layers.2.offset_fc.2.bias, roi_head.bbox_roi_extractor.roi_layers.2.offset_fc.4.weight, roi_head.bbox_roi_extractor.roi_layers.2.offset_fc.4.bias, roi_head.bbox_roi_extractor.roi_layers.3.awp.weight.conv.weight, roi_head.bbox_roi_extractor.roi_layers.3.awp.weight.bn.weight, roi_head.bbox_roi_extractor.roi_layers.3.awp.weight.bn.bias, roi_head.bbox_roi_extractor.roi_layers.3.offset_fc.0.weight, roi_head.bbox_roi_extractor.roi_layers.3.offset_fc.0.bias, roi_head.bbox_roi_extractor.roi_layers.3.offset_fc.2.weight, roi_head.bbox_roi_extractor.roi_layers.3.offset_fc.2.bias, roi_head.bbox_roi_extractor.roi_layers.3.offset_fc.4.weight, roi_head.bbox_roi_extractor.roi_layers.3.offset_fc.4.bias, roi_head.bbox_head.fc_cls.weight, roi_head.bbox_head.fc_cls.bias, roi_head.bbox_head.shared_fcs.0.weight, roi_head.bbox_head.shared_fcs.0.bias, roi_head.bbox_head.shared_fcs.1.weight, roi_head.bbox_head.shared_fcs.1.bias, roi_head.D2Det_head.convs.0.conv.weight, roi_head.D2Det_head.convs.0.gn.weight, roi_head.D2Det_head.convs.0.gn.bias, roi_head.D2Det_head.D2Det_reg.weight, roi_head.D2Det_head.D2Det_reg.bias, roi_head.D2Det_head.D2Det_mask.weight, roi_head.D2Det_head.D2Det_mask.bias, roi_head.D2Det_head.deconv1.weight, roi_head.D2Det_head.deconv1.bias, roi_head.D2Det_head.norm1.weight, roi_head.D2Det_head.norm1.bias, roi_head.D2Det_head.deconv2.weight, roi_head.D2Det_head.deconv2.bias, roi_head.D2Det_head.D2Det_instance.weight, roi_head.D2Det_head.D2Det_instance.bias, roi_head.D2Det_head.fcs.0.weight, roi_head.D2Det_head.fcs.0.bias, roi_head.D2Det_head.fcs.1.weight, roi_head.D2Det_head.fcs.1.bias, roi_head.D2Det_head.fc_instance_iou.weight, roi_head.D2Det_head.fc_instance_iou.bias

Traceback (most recent call last):
File "/home/10102010/qy/ubuntu_mmd2.3/D2Det-mmdet2.1-master/demo/D2Det_demo.py", line 30, in
main()
File "/home/10102010/qy/ubuntu_mmd2.3/D2Det-mmdet2.1-master/demo/D2Det_demo.py", line 24, in main
result = inference_detector(model, args.img_file)
File "/home/10102010/qy/ubuntu_mmd2.3/D2Det-mmdet2.1-master/demo/../mmdet/apis/inference.py", line 104, in inference_detector
result = model(return_loss=False, rescale=True, **data)
File "/home/10102010/qy/mm2.3envir/anaconda3/cd../envs/mmd21/lib/python3.6/site-packages/torch/nn/modules/module.py", line 532, in call
result = self.forward(*input, **kwargs)
File "/home/10102010/qy/ubuntu_mmd2.3/D2Det-mmdet2.1-master/demo/../mmdet/core/fp16/decorators.py", line 51, in new_func
return old_func(*args, **kwargs)
File "/home/10102010/qy/ubuntu_mmd2.3/D2Det-mmdet2.1-master/demo/../mmdet/models/detectors/base.py", line 150, in forward
return self.forward_test(img, img_metas, **kwargs)
File "/home/10102010/qy/ubuntu_mmd2.3/D2Det-mmdet2.1-master/demo/../mmdet/models/detectors/base.py", line 131, in forward_test
return self.simple_test(imgs[0], img_metas[0], **kwargs)
File "/home/10102010/qy/ubuntu_mmd2.3/D2Det-mmdet2.1-master/demo/../mmdet/models/detectors/two_stage.py", line 187, in simple_test
proposal_list = self.rpn_head.simple_test_rpn(x, img_metas)
File "/home/10102010/qy/ubuntu_mmd2.3/D2Det-mmdet2.1-master/demo/../mmdet/models/dense_heads/rpn_test_mixin.py", line 26, in simple_test_rpn
proposal_list = self.get_bboxes(*rpn_outs, img_metas)
File "/home/10102010/qy/ubuntu_mmd2.3/D2Det-mmdet2.1-master/demo/../mmdet/core/fp16/decorators.py", line 131, in new_func
return old_func(*args, **kwargs)
File "/home/10102010/qy/ubuntu_mmd2.3/D2Det-mmdet2.1-master/demo/../mmdet/models/dense_heads/anchor_head.py", line 496, in get_bboxes
scale_factor, cfg, rescale)
File "/home/10102010/qy/ubuntu_mmd2.3/D2Det-mmdet2.1-master/demo/../mmdet/models/dense_heads/rpn_head.py", line 120, in get_bboxes_single
dets, keep = batched_nms(proposals, scores, ids, nms_cfg)
File "/home/10102010/qy/ubuntu_mmd2.3/D2Det-mmdet2.1-master/demo/../mmdet/ops/nms/nms_wrapper.py", line 154, in batched_nms
torch.cat([bboxes_for_nms, scores[:, None]], -1), **nms_cfg
)
File "/home/10102010/qy/ubuntu_mmd2.3/D2Det-mmdet2.1-master/demo/../mmdet/ops/nms/nms_wrapper.py", line 53, in nms
inds = nms_ext.nms(dets_th, iou_thr)
RuntimeError: nms is not compiled with GPU support (nms at mmdet/ops/nms/src/nms_ext.cpp:23)
frame #0: c10::Error::Error(c10::SourceLocation, std::string const&) + 0x47 (0x2aaaf78d5627 in /home/10102010/qy/mm2.3envir/anaconda3/cd../envs/mmd21/lib/python3.6/site-packages/torch/lib/libc10.so)
frame #1: nms(at::Tensor const&, float) + 0xfd (0x2aab312d32cd in /home/10102010/qy/ubuntu_mmd2.3/D2Det-mmdet2.1-master/demo/../mmdet/ops/nms/nms_ext.cpython-36m-x86_64-linux-gnu.so)
frame #2: + 0x192a5 (0x2aab312df2a5 in /home/10102010/qy/ubuntu_mmd2.3/D2Det-mmdet2.1-master/demo/../mmdet/ops/nms/nms_ext.cpython-36m-x86_64-linux-gnu.so)
frame #3: + 0x15796 (0x2aab312db796 in /home/10102010/qy/ubuntu_mmd2.3/D2Det-mmdet2.1-master/demo/../mmdet/ops/nms/nms_ext.cpython-36m-x86_64-linux-gnu.so)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions