Tensorflow: ImportError: libcusolver.so.8.0: cannot open shared object file: No such file or directory

前端 未结 5 1182
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-29 22:58

I\'m having problems in importing tensorflow in python3:

>>> import tensorflow as tf
Traceback (most recent call last):
  File \"/usr/local/lib/pyth         


        
相关标签:
5条回答
  • 2020-11-29 23:27

    In addition to having the paths correctly set, the version of Tensorflow you have installed must be compatible with the CUDA driver version you have in your system otherwise it won't work. See the link

    0 讨论(0)
  • 2020-11-29 23:29

    Found the solution:

    I reinstalled nvidia-381, CUDA-8.0 (using the runfile) and cuDNN 6.0. Then I added the following in my .bashrc:

    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64/
    
    0 讨论(0)
  • 2020-11-29 23:35

    No need for reinstallation. Install nvidia-cuda-dev:

    sudo apt install nvidia-cuda-dev
    

    Install cuDNN (which you download from https://developer.nvidia.com/cudnn), and set LD_LIBRARY_PATH accordingly (to cuda/lib64).

    0 讨论(0)
  • 2020-11-29 23:35

    You could be having this problem if you installed the latest version of CUDA (9.0). If this is the case, you'll have the libcusolver.so.9.0 file or directory on your computer, but not 8.0, so python can't find it to import. Tensorflow doesn't yet support CUDA 9.0 (as of Oct 18th 2017).

    To fix this, install CUDA 8.0, which can be found here. You can find all their legacy releases at the bottom of the main download page.

    0 讨论(0)
  • 2020-11-29 23:47

    I faced this error due to incompatibility between Tensorflow version with CUDA. I had tensorflow_gpu-1.3.0, CUDA 9 and cuDNN 7 which are incompatible as per this https://www.tensorflow.org/install/source#tested_build_configurations

    so I uninstalled tensorflow_gpu-1.3.0 and installed tensorflow_gpu-1.5.0 and it worked fine

    0 讨论(0)
提交回复
热议问题