WIN10+VS2017+TensorFlow-gpu 被坑日记

安装正常来说是肥肠简单的
官方安装:Installing TensorFlow on Windows
一步步的进行没有问题,安装也安装上了,一运行:

import tensorflow as tf
Traceback (most recent call last):
  File "D:\Program Files\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in swig_import_helper
    return importlib.import_module(mname)
  File "D:\Program Files\Python35\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 986, in _gcd_import
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 666, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 577, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 906, in create_module
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
ImportError: DLL load failed: 找不到指定的模块。
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "D:\Program Files\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 41, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "D:\Program Files\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 21, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "D:\Program Files\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 20, in swig_import_helper
    return importlib.import_module('_pywrap_tensorflow_internal')
  File "D:\Program Files\Python35\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ImportError: No module named '_pywrap_tensorflow_internal'
During handling of the above exception, another exception occurred:

按理说查了一圈,找到网上说出现的问题:
1少cudnn路径(相信你一定下载了并且解压了),加入path即可
2Microsoft Visual C++ 2015 Redistributable Package (x86) 确保有这个
附上链接:http://www.microsoft.com/en-us/download/details.aspx?id=53587
3 python 必须是3.5版本(3.6目前也好使了,亲测可用)
在确保各种路径都加了绝对能找到dll之后,仍然报错
回到官网安装教程再仔细看了一遍发现:

If you have a different version of one of the preceding packages, please change to the specified versions. In particular, the cuDNN version must match exactly: TensorFlow will not load if it cannot find cuDNN64_6.dll. To use a different version of cuDNN, you must build from source.

so,自己的cudnn版本错了,回去检查了下,果然是,重新下载了6.0版本,确实是cuDNN64_6.dll,之后,运行成功

同样tensorflow里面这个问题也列出了我所面临的情况:
https://stackoverflow.com/questions/42011070/on-windows-running-import-tensorflow-generates-no-module-named-pywrap-tenso
遇到问题去网上大部分都在说1,2,3那种问题(汉语博客,当然也首先看汉语),导致浪费了一些时间
哎,仔细阅读官方安装教程才是王道。。。。。

评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值