首页 > 解决方案 > Tensorflow 可以在一个 python 文件中找到正确的 cudnn,但在另一个文件中失败

问题描述

我正在尝试使用 tensorflow gpu 版本来训练和测试我的深度学习模型。但问题来了。当我在一个 python 文件中训练我的模型时,事情进展顺利。TensorFlow-gpu 可以正常使用。然后我将我的模型保存为预训练的grapg.pb格式并尝试在另一个 python 文件中重用它。

然后我收到以下错误消息。

E tensorflow/stream_executor/cuda/cuda_dnn.cc:363] 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.

我检查了我的 cudnn 版本,实际上它是 version 7.4.2。我还检查了我的环境路径设置,,,/cuda/v9.0/bincuda/v9.0/lib/x64那里/cuda/v9.0/include

那么为什么会发生这种情况呢?我该如何解决这个问题?

--

cuda:v9.0 cudnn:(7.4.2我想,我手动复制那些 cudnn 文件)Windows 10 python:3.5

标签: tensorflowgpunvidia

解决方案


如果您CuDNN通过各种方式(如 anaconda 模块和 windows 安装)安装了多个,则需要删除旧版本,以便您的代码检测到最新版本并重新安装tensorflow-gpu
您可以按照指南根据操作系统进行安装。


推荐阅读