DeLightCMU / CASD

85 stars 21 forks source link

ImportError: libcudart.so.9.0: cannot open shared object file: No such file or directory #4

Open swzhang5 opened 3 years ago

swzhang5 commented 3 years ago

Thanks for sharing your great work. But when I run the program, I met an error. File "./tools/trainval_net.py", line 21, in from nets.vgg16 import MELM_vgg16 File "/home/username/CASD/tools/../lib/nets/vgg16.py", line 10, in from nets.network import Network File "/home/username/CASD/tools/../lib/nets/network.py", line 18, in from ops.roi_pool import RoIPool File "/home/username/CASD/tools/../lib/ops/init.py", line 9, in from .nms import nms, soft_nms File "/home/username/CASD/tools/../lib/ops/nms/init.py", line 1, in from .nms_wrapper import nms, soft_nms File "/home/username/CASD/tools/../lib/ops/nms/nms_wrapper.py", line 4, in from . import nms_cpu, nms_cuda ImportError: libcudart.so.9.0: cannot open shared object file: No such file or directory My Environment: python ==3.7.9, pytorch==1.1.0, torchvision == 0.3.0, cuda ==10.0 Do you have any solution to this error?

Justinhzy commented 3 years ago

Hi, Could you try to use 'bash make.sh' ? Tell me if it works or not. Thanks.

1170300714 commented 3 years ago

@swzhang5 , Thanks to share the problem. I met the error too. the file 'libcudart.so.9.0' means you need to run the code based on the cuda9.x. I installed the cuda9.x and solved the problem. If you have the cuda9.x and the cuda10.x at the same time, maybe you should add the cuda9.x path to your 'LD_LIBRAYR_PATH' in the .bashrc file:

export LD_LIBRARY_PATH = $LD_LIBRARY_PATH :/usr/local/cuda-9.0/lib64:/usr/local/cuda-9.0/extras/CUPTI/lib64
swzhang5 commented 3 years ago

@swzhang5 , Thanks to share the problem. I met the error too. the file 'libcudart.so.9.0' means you need to run the code based on the cuda9.x. I installed the cuda9.x and solved the problem. If you have the cuda9.x and the cuda10.x at the same time, maybe you should add the cuda9.x path to your 'LD_LIBRAYR_PATH' in the .bashrc file:

export LD_LIBRARY_PATH = $LD_LIBRARY_PATH :/usr/local/cuda-9.0/lib64:/usr/local/cuda-9.0/extras/CUPTI/lib64

Thank you very much! Your method works well for me.

caoql98 commented 3 years ago

om nets.vgg16 import MELM_vgg16 File "/project/caoqinglong/code/CASD-master/tools/../lib/nets/vgg16.py", line 10, in from nets.network import Network File "/project/caoqinglong/code/CASD-master/tools/../lib/nets/network.py", line 18, in from ops.roi_pool import RoIPool File "/project/caoqinglong/code/CASD-master/tools/../lib/ops/init.py", line 9, in from .nms import nms, soft_nms File "/project/caoqinglong/code/CASD-master/tools/../lib/ops/nms/init.py", line 1, in from .nms_wrapper import nms, soft_nms File "/project/caoqinglong/code/CASD-master/tools/../lib/ops/nms/nms_wrapper.py", line 4, in from . import nms_cpu, nms_cuda ImportError: /project/caoqinglong/code/CASD-master/tools/../lib/ops/nms/nms_cpu.cpython-37m-x86_64-linux-gnu.so: undefined symbol: _ZN2at7getTypeERKNS_6TensorE

when face the prior problem, we have change the cuda version to 9.0, and run the make_cuda.sh to recompile the code, but we face a different problem, could you help me solve it?