我鸟枪换炮用上实验室公用GPU服务器后,原来的图形工作站给另外一位师兄用来练手了,不过师兄一上来觉得图形工作站的环境太乱(在之前是公用的...),一下把所有环境都删了,自己重新配tensorflow的时候各种报错,今天检查后,发现除了CUDA和cudnn配置的不对外,tensorflow的版本也不匹配,这里主要把难点问题-tensorflow的安装给记录一下,cuda和cudnn的安装与配置请参阅:https://blog.csdn.net/qq_36396104/article/details/82851556
ERROR:【之前的忘记记录了,这里我从网上找的别人的error message】
1. 2018-05-08 09:00:18.042137: E tensorflow/stream_executor/cuda/cuda_dnn.cc:448] Loaded runtime CuDNN library: 7.0.5 but source was compiled with: 7.1.3. 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. 2. 2018-05-08 09:00:18.042768: F tensorflow/core/kernels/conv_ops.cc:713] Check failed: stream->parent()->GetConvolveAlgorithms( conv_parameters.ShouldIncludeWinogradNonfusedAlgo<T>(), &algorithms)
1. 2018-04-02 10:05:28.814376: E tensorflow/stream_executor/cuda/cuda_dnn.cc:396] Loaded runtime CuDNN library: 7102 (compatibility version 7100) but source was compiled with 7005 (compatibility version 7000). If using a binary install, up 2. grade your CuDNN library to match. If building from sources, make sure the library loaded at runtime matches a compatible version specified during compile configuration. 3. 2018-04-02 10:05:28.815023: F tensorflow/core/kernels/conv_ops.cc:712] Check failed: stream->parent()->GetConvolveAlgorithms( conv_parameters.ShouldIncludeWinogradNonfusedAlgo<T>(), &algorithms) 4. Aborted (core dumped)
SOLVE:
很简单,一看就是cuda-cudnn-tensorflow版本不匹配:Loaded runtime CuDNN library: 7102 (compatibility version 7100) but source was compiled with 7005 (compatibility version 7000). 安装好对应的版本就好了:官方版本对应表:https://www.tensorflow.org/install/source
Windows
CPU
版本 | Python 版本 | 编译器 | 编译工具 |
tensorflow-1.12.0 | 3.5-3.6 | MSVC 2015 update 3 | Cmake v3.6.3 |
tensorflow-1.11.0 | 3.5-3.6 | MSVC 2015 update 3 | Cmake v3.6.3 |
tensorflow-1.10.0 | 3.5-3.6 | MSVC 2015 update 3 | Cmake v3.6.3 |
tensorflow-1.9.0 | 3.5-3.6 | MSVC 2015 update 3 | Cmake v3.6.3 |
tensorflow-1.8.0 | 3.5-3.6 | MSVC 2015 update 3 | Cmake v3.6.3 |
tensorflow-1.7.0 | 3.5-3.6 | MSVC 2015 update 3 | Cmake v3.6.3 |
tensorflow-1.6.0 | 3.5-3.6 | MSVC 2015 update 3 | Cmake v3.6.3 |
tensorflow-1.5.0 | 3.5-3.6 | MSVC 2015 update 3 | Cmake v3.6.3 |
tensorflow-1.4.0 | 3.5-3.6 | MSVC 2015 update 3 | Cmake v3.6.3 |
tensorflow-1.3.0 | 3.5-3.6 | MSVC 2015 update 3 | Cmake v3.6.3 |
tensorflow-1.2.0 | 3.5-3.6 | MSVC 2015 update 3 | Cmake v3.6.3 |
tensorflow-1.1.0 | 3.5 | MSVC 2015 update 3 | Cmake v3.6.3 |
tensorflow-1.0.0 | 3.5 | MSVC 2015 update 3 | Cmake v3.6.3 |
GPU
版本 | Python 版本 | 编译器 | 编译工具 | cuDNN | CUDA |
tensorflow_gpu-1.12.0 | 3.5-3.6 | MSVC 2015 update 3 | Bazel 0.15.0 | 7 | 9 |
tensorflow_gpu-1.11.0 | 3.5-3.6 | MSVC 2015 update 3 | Bazel 0.15.0 | 7 | 9 |
tensorflow_gpu-1.10.0 | 3.5-3.6 | MSVC 2015 update 3 | Cmake v3.6.3 | 7 | 9 |
tensorflow_gpu-1.9.0 | 3.5-3.6 | MSVC 2015 update 3 | Cmake v3.6.3 | 7 | 9 |
tensorflow_gpu-1.8.0 | 3.5-3.6 | MSVC 2015 update 3 | Cmake v3.6.3 | 7 | 9 |
tensorflow_gpu-1.7.0 | 3.5-3.6 | MSVC 2015 update 3 | Cmake v3.6.3 | 7 | 9 |
tensorflow_gpu-1.6.0 | 3.5-3.6 | MSVC 2015 update 3 | Cmake v3.6.3 | 7 | 9 |
tensorflow_gpu-1.5.0 | 3.5-3.6 | MSVC 2015 update 3 | Cmake v3.6.3 | 7 | 9 |
tensorflow_gpu-1.4.0 | 3.5-3.6 | MSVC 2015 update 3 | Cmake v3.6.3 | 6 | 8 |
tensorflow_gpu-1.3.0 | 3.5-3.6 | MSVC 2015 update 3 | Cmake v3.6.3 | 6 | 8 |
tensorflow_gpu-1.2.0 | 3.5-3.6 | MSVC 2015 update 3 | Cmake v3.6.3 | 5.1 | 8 |
tensorflow_gpu-1.1.0 | 3.5 | MSVC 2015 update 3 | Cmake v3.6.3 | 5.1 | 8 |
tensorflow_gpu-1.0.0 | 3.5 | MSVC 2015 update 3 | Cmake v3.6.3 | 5.1 | 8 |
STEPS:
在知道正确的版本后就很好说啦:
注:如果你和我一样使用的是虚拟环境配置的,则需要先将虚拟环境激活【activate tensorflow-gpu (tensorflow-gpu是我的虚拟环境的name)】后再进行一下步骤
1、先卸载旧的tensorflow:pip uninstall tensorflow-gpu
2、安装对应版本我的是1.11.0版:pip install tensorflow-gpu==1.11
文章知识点与官方知识档案匹配,可进一步学习相关知识
Python入门技能树首页概览220433 人正在系统学习中
AIEarth是一个由众多领域内专家博主共同打造的学术平台,旨在建设一个拥抱智慧未来的学术殿堂!【平台地址:https://devpress.csdn.net/aiearth】 很高兴认识你!加入我们共同进步!