faster-rcnn.pytorch icon indicating copy to clipboard operation
faster-rcnn.pytorch copied to clipboard

No kernel image is available for execution on the device in "crop" pooling mode

Open Zhenjie-cao opened this issue 6 years ago • 6 comments

I'm using torch 0.4.0, and cuda 9.0 python 3.6. I've been stopped by this issue for several days.

while running 'python trainval_net.py --net res101 --cuda',

I got the following error:

Loading pretrained weights from data/pretrained_model/resnet101_caffe.pth pooling mode: crop error in BilinearSampler.updateOutput: no kernel image is available for execution on the device Traceback (most recent call last): File "trainval_net.py", line 323, in rois_label = fasterRCNN(im_data, im_info, gt_boxes, num_boxes) File "/opt/conda/lib/python3.6/site-packages/torch/nn/modules/module.py", line 477, in call result = self.forward(*input, **kwargs) File "/home/jovyan/pingan/nfs_4/zhenjie/faster-rcnn.pytorch-master/lib/model/faster_rcnn/faster_rcnn.py", line 90, in forward pooled_feat = self.RCNN_roi_crop(base_feat, Variable(grid_yx).detach()) File "/opt/conda/lib/python3.6/site-packages/torch/nn/modules/module.py", line 477, in call result = self.forward(*input, **kwargs) File "/home/jovyan/pingan/nfs_4/zhenjie/faster-rcnn.pytorch-master/lib/model/roi_crop/modules/roi_crop.py", line 8, in forward return RoICropFunction()(input1, input2) File "/home/jovyan/pingan/nfs_4/zhenjie/faster-rcnn.pytorch-master/lib/model/roi_crop/functions/roi_crop.py", line 14, in forward roi_crop.BilinearSamplerBHWD_updateOutput_cuda(input1, input2, output) File "/opt/conda/lib/python3.6/site-packages/torch/utils/ffi/init.py", line 202, in safe_call result = torch._C._safe_call(*args, **kwargs) torch.FatalError: aborting at /home/jovyan/pingan/nfs_4/zhenjie/faster-rcnn.pytorch-master/lib/model/roi_crop/src/roi_crop_cuda.c:49

Zhenjie-cao avatar Nov 19 '18 23:11 Zhenjie-cao

please set -arch on nvcc cmd in make.sh file. like the following

nvcc -c -o roi_pooling.cu.o roi_pooling_kernel.cu \ -D GOOGLE_CUDA=1 -x cu -Xcompiler -fPIC $CUDA_ARCH -arch sm_52

I highly recommend the author explicitly point it out...

MaureenZOU avatar Dec 17 '18 01:12 MaureenZOU

i just try the idea of MaureenZOU ,but it's not work.maybe the probelm about cuda?

air-y avatar Dec 25 '18 11:12 air-y

I am using a GTX 2080 Ti GPU, which has arch code as sm_75. If I sh make.sh, it results in nvcc fatal : Unsupported gpu architecture 'compute_75'.

Does anyone have solution for that? P.S. I have to set it up for the pytorch 0.4.0 version.

zc-alexfan avatar Mar 01 '19 18:03 zc-alexfan

You should check your cuda version. There architecture is related to your cuda version instead of GPU version. Please refer to the link https://arnon.dk/matching-sm-architectures-arch-and-gencode-for-various-nvidia-cards/

MaureenZOU avatar Mar 01 '19 18:03 MaureenZOU

I solved this problem.

My environment is cuda9.2, pytorch0.4.1, python3.6. I added [-arch sm_60] after [-D GOOGLE_CUDA=1 -x cu -Xcompiler -fPIC $CUDA_ARCH] on line 26, line 35, line 45, line 54 in lib/make.sh . which is:

  -D GOOGLE_CUDA=1 -x cu -Xcompiler -fPIC $CUDA_ARCH -arch sm_60

tayson0825 avatar Jun 03 '20 02:06 tayson0825

I am using a GTX 2080 Ti GPU, which has arch code as sm_75. If I sh make.sh, it results in nvcc fatal : Unsupported gpu architecture 'compute_75'.

Does anyone have solution for that? P.S. I have to set it up for the pytorch 0.4.0 version.

Same issue for me. How did you solve this problem 2 years before?

sjytker avatar Nov 30 '21 14:11 sjytker