question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AttributeError: module 'model.nms._ext.nms' has no attribute 'nms_cuda'

See original GitHub issue

I’m running from the master branch with PyTorch 0.4.0 and CUDA 9.0. I already ran sh make.sh and everything compiled without errors. When I run trainval_net.py, however, I’m getting this error:

Loading pretrained weights from data/pretrained_model/resnet101_caffe.pth
Traceback (most recent call last):
  File "trainval_net.py", line 320, in <module>
    rois_label = fasterRCNN(im_data, im_info, gt_boxes, num_boxes)
  File "/n/fs/unpcap/py36/lib64/python3.6/site-packages/torch/nn/modules/module.py", line 491, in __call__
    result = self.forward(*input, **kwargs)
  File "/n/fs/unpcap/bfeng/faster-rcnn.pytorch/lib/model/faster_rcnn/faster_rcnn.py", line 50, in forward
    rois, rpn_loss_cls, rpn_loss_bbox = self.RCNN_rpn(base_feat, im_info, gt_boxes, num_boxes)
  File "/n/fs/unpcap/py36/lib64/python3.6/site-packages/torch/nn/modules/module.py", line 491, in __call__
    result = self.forward(*input, **kwargs)
  File "/n/fs/unpcap/bfeng/faster-rcnn.pytorch/lib/model/rpn/rpn.py", line 78, in forward
    im_info, cfg_key))
  File "/n/fs/unpcap/py36/lib64/python3.6/site-packages/torch/nn/modules/module.py", line 491, in __call__
    result = self.forward(*input, **kwargs)
  File "/n/fs/unpcap/bfeng/faster-rcnn.pytorch/lib/model/rpn/proposal_layer.py", line 148, in forward
    keep_idx_i = nms(torch.cat((proposals_single, scores_single), 1), nms_thresh, force_cpu=not cfg.USE_GPU_NMS)
  File "/n/fs/unpcap/bfeng/faster-rcnn.pytorch/lib/model/nms/nms_wrapper.py", line 21, in nms
    return nms_gpu(dets, thresh) if force_cpu == False else nms_cpu(dets, thresh)
  File "/n/fs/unpcap/bfeng/faster-rcnn.pytorch/lib/model/nms/nms_gpu.py", line 10, in nms_gpu
    nms.nms_cuda(keep, dets, num_out, thresh)
AttributeError: module 'model.nms._ext.nms' has no attribute 'nms_cuda'
srun: error: node717: task 0: Exited with exit code 1

Any idea why this is happening? Thank you!

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:3
  • Comments:8

github_iconTop GitHub Comments

1reaction
lininglouiscommented, Jan 19, 2019

Compile the cuda dependencies using following simple commands:] cd lib sh make.sh

Read the documentation

0reactions
chansongoalcommented, May 12, 2020

Hi, @mohanrobotics Could you please provide me a docker image? Appreciate it if you help me!

Read more comments on GitHub >

github_iconTop Results From Across the Web

AttributeError: 'module' object has no attribute 'model'
It's called models.Model and not models.model (case sensitive). Fix your Poll model like this - class Poll(models.Model): question = models.
Read more >
Blog - Open3D
Here are the highlights: Open3D visualization now works on Google Colab, and CPU rendering is now easy to use on all Linux machines....
Read more >
Changelog — MMDetection 2.26.0 documentation
This change has no effect on the pre-trained models in the v2.x model zoo, but will affect the training of all models with...
Read more >
ModuleNotFoundError: No Module named nms.gpu_nms
If your program nms_wrapper is unable to find nms.gpu_nms or nms.cpu_nms then we need to do a few modifications in the nms.wrapper.py file...
Read more >
RuntimeError: CUDA error: no kernel image is available for ...
RuntimeError: CUDA error: no kernel image is available for execution ... line 1, in <module> AttributeError: module 'torch' has no attribute ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found