解决安装TensorFlow GPU缺少文件的一个比较终极的办法
可能的报错信息
TensorFlow 下,导入这份配置的时候 python 停止运行
ImportError: DLL load failed: 找不到指定的模块 或 ImportError: No module named ‘_pywrap_tensorflow’ 或 Failed to load the native TensorFlow runtime.
importlib.import_module(mname)
等等类似的
我的出错配置
tensorflow_gpu-1.2.1
cudnn-8.0-windows7-x64-v6.0.0
或者cudnn-8.0-windows7-x64-v7.1
或者cudnn-8.0-windows7-x64-v7
以上的cudnn都是错误的,得使用
cudnn-8.0-windows7-x64-v5.1
下面说下怎么知道的
直接放代码。
在部署好的环境里面运行这份代码会给出相应的提示。
https://gist.github.com/mrry/ee5dbcfdd045fa48a27d56664411d41c
依据提示去看自己缺少什么。
附录原文
https://github.com/tensorflow/tensorflow/issues/7623
code
Let's see ... following is the info. After running tensorflow_self_check.py I see that it doesn't find a couple of cud*.dll needed for the GPU version of tensorflow. That's probably because I assumed I already had that installed as part of the NVIDIA software that comes with this PC. That's what I get for assuming!
NVIDIA GeForce GTX 960, 2GB
Intel Core i7-6700K @ 4.0GHz
C:\Users\jeffh>pip list | findstr tensorflow
tensorflow-gpu (1.2.1)
Run tensorflow_self_check.py script (note - syntax error line 111 of https://gist.github.com/mrry/ee5dbcfdd045fa48a27d56664411d41c ):
C:\Users\jeffh\Downloads>python tensorflow_self_check.py
ERROR: Failed to import the TensorFlow module.
Python version is 3.5.
TensorFlow is installed at: C:\Users\jeffh\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow
Could not load 'cudart64_80.dll'. The GPU version of TensorFlow
requires that this DLL be installed in a directory that is named in
your %PATH% environment variable. Download and install CUDA 8.0 from
this URL: https://developer.nvidia.com/cuda-toolkitCould not load 'cudnn64_5.dll'. The GPU version of TensorFlow
requires that this DLL be installed in a directory that is named in
your %PATH% environment variable. Note that installing cuDNN is a
separate step from installing CUDA, and it is often found in a
different directory from the CUDA DLLs. You may install the
necessary DLL by downloading cuDNN 5.1 from this URL:
https://developer.nvidia.com/cudnn
Traceback (most recent call last):
File "tensorflow_self_check.py", line 137, in
main()
File "tensorflow_self_check.py", line 108, in main
if not cudnn5_found or not cudnn6_found:
UnboundLocalError: local variable 'cudnn5_found' referenced before assignment
- 配置pycharm远程调试的环境(服务器为linux系统)&&服务器上安装tensorflow-gpu及配置cuda环境&&相关问题的解决办法
- redflag Dc5.0,Asianux2安装时无法创建文件系统,缺少scsi驱动解决办法
- linux环境下安装eclipse,缺少jre文件解决办法
- Windows10下安装TensorFlow GPU版 及遇到的问题解决办法
- 关于在线安装vs2017缺少头文件的解决办法
- myEclipe的一个bug 缺少引用的包时出现不能生成编译后的class文件的解决办法
- make menuconfig出错,需要安装libncurses5-dev找不到文件的终极解决办法(不必更换源,适用于ubuntu 32位平台)
- 关于用硬盘安装工具Win6Ins_v1.2.0.62安装时提示缺少hildr.mbr文件的解决办法
- 安装OFFICE提示“windows installer服务不能更新一个或多个受保护的windows文件”解决办法
- TensorFlow(gpu)的安装错误解决办法
- iis安装经常出现的找不到xxx文件的一个原因及解决办法
- 用VS2005打开一个.NET2.0方案,里面有几个工程和一个网站,提示网站的项目.csproj文件无法打开:“此安装不支持该项目类型”,的解决办法。
- "无法找到运行搜索助理需要的一个文件,您可能需要运行安装"的解决办法
- SQL Server安装文件挂起错误解决办法【转帖】
- sql server 2000 以前的某个程序安装已在安装计算机上创建挂起的文件操作解决办法
- SQL server2000 安装文件挂起错误的解决办法
- 关于:以前的某个程序安装已在安装计算机上创建挂起的文件操作解决办法(SQL2000)
- sql server 2000 以前的某个程序安装已在安装计算机上创建挂起的文件操作解决办法
- 安装NET过程中反复提示有一个程序需要重启,但是重启依旧解决办法
- 解决Apache日志文件ACCESS.LOG日益膨胀的一个办法