When I try to test the network I get the following error:
Traceback (most recent call last):
File "test_net.py", line 242, in <module>
rois_label = fasterRCNN(im_data, im_info, gt_boxes, num_boxes)
File "/home/rizhiy/anaconda3/envs/faster-rcnn.pytorch/lib/python3.6/site-packages/torch/nn/modules/module.py", line 357, in __call__
result = self.forward(*input, **kwargs)
File "/home/rizhiy/object-detection/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 "/home/rizhiy/anaconda3/envs/faster-rcnn.pytorch/lib/python3.6/site-packages/torch/nn/modules/module.py", line 357, in __call__
result = self.forward(*input, **kwargs)
File "/home/rizhiy/object-detection/faster-rcnn.pytorch/lib/model/rpn/rpn.py", line 78, in forward
im_info, cfg_key))
File "/home/rizhiy/anaconda3/envs/faster-rcnn.pytorch/lib/python3.6/site-packages/torch/nn/modules/module.py", line 357, in __call__
result = self.forward(*input, **kwargs)
File "/home/rizhiy/object-detection/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)
File "/home/rizhiy/object-detection/faster-rcnn.pytorch/lib/model/nms/nms_wrapper.py", line 18, in nms
return nms_gpu(dets, thresh)
File "/home/rizhiy/object-detection/faster-rcnn.pytorch/lib/model/nms/nms_gpu.py", line 10, in nms_gpu
nms.nms_cuda(keep, dets, num_out, thresh)
File "/home/rizhiy/anaconda3/envs/faster-rcnn.pytorch/lib/python3.6/site-packages/torch/utils/ffi/__init__.py", line 198, in safe_call
result = torch._C._safe_call(*args, **kwargs)
TypeError: initializer for ctype 'struct THCudaIntTensor *' must be a pointer to same type, not cdata 'struct THIntTensor *'
It seems, there is a problem with gpu nms. How can I fix this?
this is because it should be tested on GPU. so add '--cuda' to the end of your command.
@jwyang hello,i run the command as this,i meet same problem.
CUDA_VISIBLE_DEVICES=0 python trainval_net.py \
--dataset pascal_voc \
--net vgg16 \
--bs 1\
--nw 0 \
--lr 0.001 \
--lr_decay_step 5 \
--save_dir output/models \
--cuda
CUDA_VISIBLE_DEVICES=0 is not a command.
But it runs ok.
https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html
A comma-separated sequence of GPU identifiers
Anyway after adding --cuda to the command, it started running.
Because there are default parameters, I just run the following command.
python trainval_net.py --cuda
Most helpful comment
this is because it should be tested on GPU. so add '--cuda' to the end of your command.