tensorflow - 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/bin
在cuda/v9.0/lib/x64
那里/cuda/v9.0/include
。
那么为什么会发生这种情况呢?我该如何解决这个问题?
--
cuda:
v9.0
cudnn:(7.4.2
我想,我手动复制那些 cudnn 文件)Windows 10 python:3.5
解决方案
如果您CuDNN
通过各种方式(如 anaconda 模块和 windows 安装)安装了多个,则需要删除旧版本,以便您的代码检测到最新版本并重新安装tensorflow-gpu
。
您可以按照本指南根据操作系统进行安装。
推荐阅读
- react-select - 有没有办法自动显示 React-Select 的可用选项
- arrays - ngrx 中的 Observable 数组为空
- python - 如何让程序“读取”并复制文本文件的内容?
- elasticsearch - ElasticSearch BulkShardRequest 由于 org.elasticsearch.common.util.concurrent.EsThreadPoolExecutor 而失败
- javascript - 如何仅返回数组中唯一的值?
- c++ - C++链表类实现
- sqlite - QT5 SQLite“参数计数不匹配”问题
- r - 通过前两个字符串对特定行进行子集
- swift - 在模态上呈现模态会在导航栏和视图内容之间增加一个间隙
- c# - Azure Function 函数如何使用托管标识获取对 Azure 表存储的引用?