rbgirshick / py-faster-rcnn

Faster R-CNN (Python implementation) -- see https://github.com/ShaoqingRen/faster_rcnn for the official MATLAB version
Other
8.12k stars 4.11k forks source link

ImportError: libcudart.so.7.0: cannot open shared object file: No such file or directory #324

Open monajalal opened 8 years ago

monajalal commented 8 years ago

I get the following error when I run the sample:

mona@pascal:~/computer_vision/py-faster-rcnn$ ./tools/demo.py
Traceback (most recent call last):
  File "./tools/demo.py", line 18, in <module>
    from fast_rcnn.test import im_detect
  File "/home/mona/computer_vision/py-faster-rcnn/tools/../lib/fast_rcnn/test.py", line 17, in <module>
    from fast_rcnn.nms_wrapper import nms
  File "/home/mona/computer_vision/py-faster-rcnn/tools/../lib/fast_rcnn/nms_wrapper.py", line 9, in <module>
    from nms.gpu_nms import gpu_nms
ImportError: libcudart.so.7.0: cannot open shared object file: No such file or directory

I have the following system settings:

CuDNN V4
$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2015 NVIDIA Corporation
Built on Tue_Aug_11_14:27:32_CDT_2015
Cuda compilation tools, release 7.5, V7.5.17
$ uname -a
Linux pascal 3.13.0-62-generic #102-Ubuntu SMP Tue Aug 11 14:29:36 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
$ lspci | grep -i nvidia
03:00.0 3D controller: NVIDIA Corporation GK110BGL [Tesla K40c] (rev a1)
83:00.0 3D controller: NVIDIA Corporation GK110BGL [Tesla K40c] (rev a1)
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.04.5 LTS
Release:    14.04
Codename:   trusty
$ gcc --version
gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

What is the issue and how can it be solved?

monajalal commented 8 years ago

In my case I changed the paths to use the already installed Cuda7.0. Seems Cuda7.5 is not compatible with Ubuntu 14.04?

D3Nd3R commented 8 years ago

I think you should add the next lines to the .bashrc file. But I did it on Ubuntu 16.04 and cuda 8.0. export PATH=/usr/local/cuda-7.0/bin${PATH:+:${PATH}} export LD_LIBRARY_PATH=/usr/local/cuda-7.0/lib64${LD_LIBRARY_PATH:+: ${LD_LIBRARY_PATH}}

ravikantb commented 8 years ago

I also faced the similar issue with CUDA 8.0 not being detected and the training code instead looking for older CUDA 7.5. I updated my PATH and LD_LIBRARY_PATH flags but it didn't resolve. Something more was needed. The hint lied in the error log itself.

The line: from nms.gpu_nms import gpu_nms is from 'nms_wrapper.py' which is in 'lib/fast_rcnn' directory of faster-RCNN module. The same 'lib' directory also contains 'nms/gpu_nms.so' which in my case was built against older CUDA 7.5. And whenever I did 'make' in 'lib' directory after updating my CUDA to 8.0 (as per the instruction in README), nothing was being done as older copy was already present. I removed all the '.so' files in 'lib' directory and did a 'make' again. This time new .so files were created using CUDA 8.0 (you can verify that from the build logs also).

Now my training is running smoothly (so far, fingers crossed!).

eswears commented 7 years ago

This fixed the problem for me: sudo ldconfig /usr/local/cuda/lib64

PapaMadeleine2022 commented 6 years ago

modify the CUDA_DIR in Makefile.config