运行程序错误:
nsorflow/stream_executor/cuda/cuda_dnn.cc:343] Loaded runtime CuDNN library: 7.1.4 but source was compiled with: 7.2.1. CuDNN library major and minor version needs to match or have higher minor version in case of CuDNN 7.0 or later version. If using a binary install, upgrade your CuDNN library. If building from sources, make sure the library loaded at runtime is compatible with the version specified during compile configuration.
段错误 (核心已转储)
原因:tensorflow-gpu==1.11 是基于cudnn7.2.1.当前版本为7.1.4。
解决方案:升级cudnn
主要看你安装cudnn的方式,目前两种方法
1. .deb
2. .tgz
我采用的第二种,(升级方案是不同的)
首先下载 cudnn-9.0-linux-x64-v7.3.0.29.tgz 地址:https://developer.nvidia.com/rdp/cudnn-archive
找到对应的cuda版本,下载For Linux. 也就是第一个文件。
解压为cuda文件夹
cuda文件夹下的目录
在cuda目录下打开终端:
输入卸载上个版本的命令:
sudo rm -rf /usr/local/cuda/include/cudnn.h
sudo rm -rf /usr/local/cuda/lib64/libcudnn*
然后再输入:
sudo cp include/cudnn.h /usr/local/cuda/include/
sudo cp lib64/lib* /usr/local/cuda/lib64/
cd到/usr/local/cuda/lib64/文件夹下,建立软链接
cd /usr/local/cuda/lib64/
sudo chmod +r libcudnn.so.7.3.0
sudo ln -sf libcudnn.so.7.3.0 libcudnn.so.7
sudo ln -sf libcudnn.so.6 libcudnn.so
sudo ldconfig
完成