Tung-I / Dual-awareness-Attention-for-Few-shot-Object-Detection

94 stars 16 forks source link

RuntimeError: Not compiled with GPU support | Any idea? #13

Closed massih10 closed 3 years ago

massih10 commented 3 years ago

I'm getting the following error on a docker image:

(DAnA) root@jupyter:~/Dual-awareness-Attention-for-Few-shot-Object-Detection/lib# python inference.py --eval --dataset val2014_novel --net DAnA --r --load_dir models/DAnA_coco_ft30 --checkepoch 4 --checkpoint 299 --bs 1 --shot 3 --eval_dir dana
Namespace(ascale=4, batch_size=1, cfg_file='cfgs/res50.yml', checkepoch=4, checkpoint=299, dataset='val2014_novel', disp_interval=100, dlog=False, eval=True, eval_dir='dana', fewshot=False, imdbval_name='coco_20_set1', imlog=False, large_scale=False, load_dir='models/DAnA_coco_ft30', lr=0.001, lr_decay_gamma=0.1, lr_decay_step=1000, mGPUs=False, max_epochs=12, net='DAnA', num_workers=8, old_n_classes=81, optimizer='sgd', resume=True, save_dir='models', set_cfgs=['ANCHOR_SCALES', '[4, 8, 16, 32]', 'ANCHOR_RATIOS', '[0.5,1,2]', 'MAX_NUM_GT_BOXES', '50'], shot=3, start_epoch=1, sup_dir='all', use_flip=False, way=1)
coco_20_set1
loading annotations into memory...
Done (t=0.16s)
creating index...
index created!
Loaded dataset `coco_set1_20` for training
Set proposal method: gt
Preparing training data...
done
loading annotations into memory...
Done (t=0.25s)
creating index...
index created!
load checkpoint models/DAnA_coco_ft30/train/checkpoints/model_4_299.pth
load model successfully!
coco_20_set1
loading annotations into memory...
Done (t=0.20s)
creating index...
index created!
Loaded dataset `coco_set1_20` for training
Set proposal method: gt
Preparing training data...
done
loading annotations into memory...
Done (t=0.12s)
creating index...
index created!
  0%|                                                                                                                                                                                                                                                                                                                                   | 0/4031 [00:00<?, ?it/s]
Traceback (most recent call last):
  File "inference.py", line 103, in <module>
    rois_label = model(im_data, im_info, gt_boxes, num_boxes, support_ims)
  File "/opt/conda/envs/DAnA/lib/python3.6/site-packages/torch/nn/modules/module.py", line 547, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/jovyan/Dual-awareness-Attention-for-Few-shot-Object-Detection/lib/model/framework/dana.py", line 158, in forward
    rois, rpn_loss_cls, rpn_loss_bbox = self.RCNN_rpn(correlation_feat, im_info, gt_boxes, num_boxes)
  File "/opt/conda/envs/DAnA/lib/python3.6/site-packages/torch/nn/modules/module.py", line 547, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/jovyan/Dual-awareness-Attention-for-Few-shot-Object-Detection/lib/model/rpn/rpn.py", line 78, in forward
    im_info, cfg_key))
  File "/opt/conda/envs/DAnA/lib/python3.6/site-packages/torch/nn/modules/module.py", line 547, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/jovyan/Dual-awareness-Attention-for-Few-shot-Object-Detection/lib/model/rpn/proposal_layer.py", line 167, in forward
    keep_idx_i = nms(proposals_single, scores_single.squeeze(1), nms_thresh)
RuntimeError: Not compiled with GPU support (nms at /home/jovyan/Dual-awareness-Attention-for-Few-shot-Object-Detection/lib/model/csrc/nms.h:22)
frame #0: c10::Error::Error(c10::SourceLocation, std::string const&) + 0x47 (0x7f100bb2ce37 in /opt/conda/envs/DAnA/lib/python3.6/site-packages/torch/lib/libc10.so)
frame #1: <unknown function> + 0x9f9b (0x7f0f503f7f9b in /home/jovyan/Dual-awareness-Attention-for-Few-shot-Object-Detection/lib/model/_C.cpython-36m-x86_64-linux-gnu.so)
frame #2: <unknown function> + 0x1da89 (0x7f0f5040ba89 in /home/jovyan/Dual-awareness-Attention-for-Few-shot-Object-Detection/lib/model/_C.cpython-36m-x86_64-linux-gnu.so)
frame #3: <unknown function> + 0x1b431 (0x7f0f50409431 in /home/jovyan/Dual-awareness-Attention-for-Few-shot-Object-Detection/lib/model/_C.cpython-36m-x86_64-linux-gnu.so)
<omitting python frames>
frame #57: __libc_start_main + 0xe7 (0x7f1054690bf7 in /lib/x86_64-linux-gnu/libc.so.6)

Any idea what's going on?

massih10 commented 3 years ago

With the software in this docker image together with the env.yml, it is possible to run the model:

FROM nvidia/cuda:10.0-devel-ubuntu18.04
USER root
WORKDIR /tmp/
COPY cudnn-10.0-linux-x64-v7.6.2.24.tgz /tmp/cudnn-10.0-linux-x64-v7.6.2.24.tgz
RUN tar zxvf cudnn-10.0-linux-x64-v7.6.2.24.tgz 
RUN mv /tmp/cuda/lib64/* /usr/local/cuda/lib64/
RUN mv /tmp/cuda/include/* /usr/local/cuda/include/
RUN chmod a+r /usr/local/cuda/include/cudnn*.h /usr/local/cuda/lib64/libcudnn*
COPY libcudnn7_7.6.2.24-1+cuda10.0_amd64.deb /tmp/libcudnn7_7.6.2.24-1+cuda10.0_amd64.deb
COPY libcudnn7-dev_7.6.2.24-1+cuda10.0_amd64.deb /tmp/libcudnn7-dev_7.6.2.24-1+cuda10.0_amd64.deb
RUN cd /tmp/
RUN dpkg -i libcudnn7_7.6.2.24-1+cuda10.0_amd64.deb
RUN dpkg -i libcudnn7-dev_7.6.2.24-1+cuda10.0_amd64.deb

cudnn needs to be downloaded from nvidia webpage