TensorFlow:ImportError: libcudnn.so.*: cannot open shared object file: No such file or dictionary

前端之家收集整理的这篇文章主要介绍了TensorFlow:ImportError: libcudnn.so.*: cannot open shared object file: No such file or dictionary前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

环境:

  • Ubuntu16.04
  • Nvidia 384
  • CUDA 8.0
  • cuDNN 5

错误

TensorFlow、CUDA、cuDNN的版本关系小白我时常懵懵的,经常出现各种不支持的情况,比如今天安装了TensorFlow1.4,报错:ImportError: libcudnn.so.6: cannot open shared object file: No such file or dictionary


错误缘由

google了一圈发现, 问题出在 TensorFlow 1.4-gpu 是基于cuDNN6,需要的也就是libcudnn.so.6了。


解决方案:

  • Just download cuDNN v6 and follow the steps (Tested on Ubuntu 16.04,CUDA toolkit 8.0 )https://developer.nvidia.com/cudnn
    $ tar xvzf cudnn-8.0-linux-x64-v5.1-ga.tgz
    $ sudo cp -P cuda/include/cudnn.h /usr/local/cuda/include
    $ sudo cp -P cuda/lib64/libcudnn* /usr/local/cuda/lib64
    $ sudo chmod a+r /usr/local/cuda/include/cudnn.h /usr/local/cuda/lib64/libcudnn*
  • Now set Path variables
  • $ vim ~/.bashrc 翻到最底部加上: export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64" export CUDA_HOME=/usr/local/cuda
原文链接:https://www.f2er.com/ubuntu/350682.html

猜你在找的Ubuntu相关文章