Hi, when I run test_net.py on CPU (sans --cuda), I get:
load checkpoint ./ckpts/res101/pascal_voc/faster_rcnn_1_1_10021.pth
load model successfully!
CUDA Error: invalid argument, at line 147
CUDA Error: invalid argument, at line 154
followed by:
raceback (most recent call last):
File "test_net.py", line 244, in <module>
rois_label = fasterRCNN(im_data, im_info, gt_boxes, num_boxes)
File "/home/mvm_dev11/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 491, in __call__
result = self.forward(*input, **kwargs)
File "/home/mvm_dev11/faster-rcnn/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 "/home/mvm_dev11/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 491, in __call__
result = self.forward(*input, **kwargs)
File "/home/mvm_dev11/faster-rcnn/lib/model/rpn/rpn.py", line 78, in forward
im_info, cfg_key))
File "/home/mvm_dev11/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 491, in __call__
result = self.forward(*input, **kwargs)
File "/home/mvm_dev11/faster-rcnn/lib/model/rpn/proposal_layer.py", line 162, in forward
output[i,:num_proposal,1:] = proposals_single
RuntimeError: dimension out of range (expected to be in range of [-1, 0], but got 1)
Upon checking, no proposals are being generated at all:
proposals_single: torch.Size([0])
num_proposal: 0
output: torch.Size([1, 300, 5])
I'm guessing it is because of the CUDA errors on top. But can't find the source of these errors. Can someone help? Training and testing are both running fine on GPU.
Thanks
@cbasavaraj this issue I met, and I solved it by change the cfg.USE_GPU_NMS to False, and you can use nms_cpu to replace nms_gpu, so actually this project can run on both gpu and cpu.
I think this issue can be closed.
Hi @cbasavaraj , did you solve this issue? I am facing the same problem in the fpn.pytorch repo where the CPU version is not available. Could you please tell me how to solve this error for the GPU version itself
Hi @Karthik-Suresh93 , it's been a while, sorry I don't remember what exactly I did for this problem. But I remember the code was not great for running on CPU, so mostly ran on GPU.
If your issue is in spite of running on GPU, take some time to print out the tensor shapes and figure out what's happening. I'm really busy these days, don't think I can examine myself in detail. But if you have a specific question, I can answer.
@cbasavaraj thank you
@cbasavaraj did you solve this issue? I am facing the same problem !
don't run it on cpu. i solve it by runing on gpu.
Most helpful comment
@cbasavaraj this issue I met, and I solved it by change the cfg.USE_GPU_NMS to False, and you can use nms_cpu to replace nms_gpu, so actually this project can run on both gpu and cpu.
I think this issue can be closed.