6

Ubuntu 14.04,CUDA 版本 7.5.18,tensorflow 的夜间构建

tf.nn.max_pool()在 tensorflow 中运行操作时,出现以下错误:

E tensorflow/stream_executor/cuda/cuda_dnn.cc:286] 已加载 cudnn 库:5005 但源代码是针对 4007 编译的。如果使用二进制安装,请升级您的 cudnn 库以匹配。如果从源代码构建,请确保加载的库与您在编译配置期间指定的版本相匹配。

W tensorflow/stream_executor/stream.cc:577] 试图在没有 DNN 支持的情况下使用 StreamExecutor 执行 DNN 操作

回溯(最近一次通话最后):

...

如何在 tensorflow 的编译配置中指定我的 cudnn 版本?

4

4 回答 4

2

进入TensorFlow源码目录,然后执行配置文件:/.configure.

这是TensorFlow 文档中的一个示例:

$ ./configure
Please specify the location of python. [Default is /usr/bin/python]:
Do you wish to build TensorFlow with GPU support? [y/N] y
GPU support will be enabled for TensorFlow

Please specify which gcc nvcc should use as the host compiler. [Default is
/usr/bin/gcc]: /usr/bin/gcc-4.9

Please specify the Cuda SDK version you want to use, e.g. 7.0. [Leave
empty to use system default]: 7.5

Please specify the location where CUDA 7.5 toolkit is installed. Refer to
README.md for more details. [default is: /usr/local/cuda]: /usr/local/cuda

Please specify the Cudnn version you want to use. [Leave empty to use system
default]: 4.0.4

Please specify the location where the cuDNN 4.0.4 library is installed. Refer to
README.md for more details. [default is: /usr/local/cuda]: /usr/local/cudnn-r4-rc/

Please specify a list of comma-separated Cuda compute capabilities you want to
build with. You can find the compute capability of your device at:
https://developer.nvidia.com/cuda-gpus.
Please note that each additional compute capability significantly increases your
build time and binary size. [Default is: \"3.5,5.2\"]: 3.5

Setting up Cuda include
Setting up Cuda lib64
Setting up Cuda bin
Setting up Cuda nvvm
Setting up CUPTI include
Setting up CUPTI lib64
Configuration finished
于 2016-06-06T17:08:06.827 回答
1

好像你已经安装了 cudnn 5。运行时需要设置./configure

Please specify the Cudnn version you want to use. [Leave empty to use system
default]: 5
于 2016-06-06T17:27:15.807 回答
1

添加我的 2 美分:在我的情况下(TF0.12.1,从 安装到 anaconda pip,没有sudo权限)CuDNNv5 已安装,但不是默认设置。

设置export LD_LIBRARY_PATH="/usr/local/lib/cuda-8.0/lib64:/usr/local/lib/cudann5/lib64/"解决了问题

于 2017-02-15T10:38:52.460 回答
0

我也遇到了这样的不兼容问题:

Loaded runtime CuDNN library: 5005 (compatibility version 5000) but source wascompiled with 5110 (compatibility version 5100).  If using a binary install, upgrade your CuDNNlibrary to match.  If building fromsources, make sure the library loaded at runtime matches a compatible versionspecified during compile configuration.

所以我下载了 CuDNN 5.1(与 CUDA8.0 兼容)并用它替换了 5.0,然后一切顺利。

警告:来自 nvidia 的CuDNN不可用,但您可以从其他人的共享中找到它。

于 2017-09-11T14:07:08.560 回答