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

RuntimeError: Expected cudaMemcpy(&mask_host[0], mask_dev, sizeof(unsigned long long) * boxes_num * col_blocks, cudaMemcpyDeviceToHost) == cudaSuccess to be true, but got false. (Could this error message be improved? If so, please report an enhancement request to PyTorch.) #157

Closed
fuma8 opened this issue Jan 20, 2023 · 1 comment

Comments

@fuma8
Copy link

fuma8 commented Jan 20, 2023

Describe the bug
I run the code below, but get the error. Can anyone help me?

Reproduction

  1. What command or script did you run?
python tools/demo.py configs/elephant/cityperson/cascade_hrnet.py ./models_pretrained/epoch_5.pth.stu demo/ result_demo/ 
  1. Did you make any modifications on the code or config? Did you understand what you have modified?
  2. What dataset did you use?

Environment

  • OS: Ubuntu20.04
  • GCC 11.1.0
  • PyTorch version 1.13.1+cu117
  • How you installed PyTorch pip
  • GPU model 1080Ti
  • CUDA and CUDNN version 11.7

Error traceback
If applicable, paste the error trackback here.

['demo/2.png', 'demo/3.png', 'demo/1.png']
unexpected key in source state_dict: mask_head.0.conv_res.conv.weight, mask_head.0.conv_res.conv.bias, mask_head.1.conv_res.conv.weight, mask_head.1.conv_res.conv.bias, mask_head.2.conv_res.conv.weight, mask_head.2.conv_res.conv.bias

/home/kimishima/Downloads/Pedestron/mmdet/apis/inference.py:39: UserWarning: Class names are not saved in the checkpoint's meta data, use COCO classes by default.
  warnings.warn('Class names are not saved in the checkpoint\'s '
[                      ] 0/3, elapsed: 0s, ETA:/home/kimishima/Downloads/Pedestron/mmdet/core/bbox/transforms.py:56: UserWarning: This overload of addcmul is deprecated:
        addcmul(Tensor input, Number value, Tensor tensor1, Tensor tensor2, *, Tensor out)
Consider using one of the following signatures instead:
        addcmul(Tensor input, Tensor tensor1, Tensor tensor2, *, Number value, Tensor out) (Triggered internally at ../torch/csrc/utils/python_arg_parser.cpp:1420.)
  gx = torch.addcmul(px, 1, pw, dx)  # gx = px + pw * dx
Traceback (most recent call last):
  File "tools/demo.py", line 67, in <module>
    run_detector_on_dataset()
  File "tools/demo.py", line 63, in run_detector_on_dataset
    detections = mock_detector(model, im, output_dir)
  File "tools/demo.py", line 37, in mock_detector
    results = inference_detector(model, image)
  File "/home/kimishima/Downloads/Pedestron/mmdet/apis/inference.py", line 66, in inference_detector
    return _inference_single(model, imgs, img_transform, device)
  File "/home/kimishima/Downloads/Pedestron/mmdet/apis/inference.py", line 93, in _inference_single
    result = model(return_loss=False, rescale=True, **data)
  File "/home/kimishima/anaconda3/envs/open-mmlab/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl
    return forward_call(*input, **kwargs)
  File "/home/kimishima/Downloads/Pedestron/mmdet/core/fp16/decorators.py", line 49, in new_func
    return old_func(*args, **kwargs)
  File "/home/kimishima/Downloads/Pedestron/mmdet/models/detectors/base.py", line 88, in forward
    return self.forward_test(img, img_meta, **kwargs)
  File "/home/kimishima/Downloads/Pedestron/mmdet/models/detectors/base.py", line 79, in forward_test
    return self.simple_test(imgs[0], img_metas[0], **kwargs)
  File "/home/kimishima/Downloads/Pedestron/mmdet/models/detectors/cascade_rcnn.py", line 242, in simple_test
    proposal_list = self.simple_test_rpn(
  File "/home/kimishima/Downloads/Pedestron/mmdet/models/detectors/test_mixins.py", line 10, in simple_test_rpn
    proposal_list = self.rpn_head.get_bboxes(*proposal_inputs)
  File "/home/kimishima/Downloads/Pedestron/mmdet/core/fp16/decorators.py", line 127, in new_func
    return old_func(*args, **kwargs)
  File "/home/kimishima/Downloads/Pedestron/mmdet/models/anchor_heads/anchor_head.py", line 219, in get_bboxes
    proposals = self.get_bboxes_single(cls_score_list, bbox_pred_list,
  File "/home/kimishima/Downloads/Pedestron/mmdet/models/anchor_heads/rpn_head.py", line 92, in get_bboxes_single
    proposals, _ = nms(proposals, cfg.nms_thr)
  File "/home/kimishima/Downloads/Pedestron/mmdet/ops/nms/nms_wrapper.py", line 43, in nms
    inds = nms_cuda.nms(dets_th, iou_thr)# inds = nms_cuda.nms(dets_th, iou_thr)
RuntimeError: Expected cudaMemcpy(&mask_host[0], mask_dev, sizeof(unsigned long long) * boxes_num * col_blocks, cudaMemcpyDeviceToHost) == cudaSuccess to be true, but got false.  (Could this error message be improved?  If so, please report an enhancement request to PyTorch.)
@fuma8 fuma8 closed this as completed Jan 20, 2023
@ashuta03
Copy link

I am getting the same error. Did you find a solution?

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