ow可以在一个python文件中找到正确的cudnn但在另一个文

ow可以在一个python文件中找到正确的cudnn但在另一个文

本文介绍了Tensorflow可以在一个python文件中找到正确的cudnn但在另一个文件中失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am trying to use tensorflow gpu version to train and test my deep learning model. But here comes the problem. When I train my model in one python file things go on well. Tensorflow-gpu can be used properly. Then I save my model as a pretrained on as grapg.pb format and try to reuse it in another python file.

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

Then I got the following error messages.

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版本,实际上它是版本 7.4.2 .我还检查了我的环境路径设置/cuda/v9.0/bin cuda/v9.0/lib/x64 /cuda/v9.0/包含在其中.

I checked my cudnn version, in fact it is version 7.4.2. I also checked my environment path settings /cuda/v9.0/bin, cuda/v9.0/lib/x64, /cuda/v9.0/include are in there.

那为什么会这样呢?而我该如何解决呢?

So why this happens? And how can I solve this?

-

推荐答案

如果您通过anaconda模块和Windows安装等多种方式安装了多个 CuDNN ,则需要删除较旧的版本,以便您的代码以检测最新版本并重新安装 tensorflow-gpu .
您可以按照指南进行基于OS的安装.

If you have multiple CuDNN installed thorough various ways like anaconda module and windows installation, you need to remove the older version in order for your code to detect the latest version and reinstall tensorflow-gpu.
You can follow this guide for installation based on OS.

这篇关于Tensorflow可以在一个python文件中找到正确的cudnn但在另一个文件中失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-30 04:18