Win10 安装 Tensorflow 及_pywrap_tensorflow_internal 问题解决

最近在看一些机器学习相关的事情,听说Google深度学习框架Tensorflow很火,于是下下来看看

安装步骤照着官网一步一步来的

https://www.tensorflow.org/install/


一行命令解决,但是装完以后出现了一个错误 :

ImportError: No module named ‘_pywrap_tensorflow_internal’Python 3.5.0 (v3.5.0:374f501f4567, Sep 13 2015, 02:27:37) [MSC v.1900 64 bit (AMD64)] on win32

Type “help”, “copyright”, “credits” or “license” for more information.
>>> import tensorflow
Traceback (most recent call last):
File “C:\Program Files\Python 3.5\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py”, line 18, in swig_import_helper
return importlib.import_module(mname)
File “C:\Program Files\Python 3.5\lib\importlib\__init__.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 986, in _gcd_import
File “”, line 969, in _find_and_load
File “”, line 958, in _find_and_load_unlocked
File “”, line 666, in _load_unlocked
File “”, line 577, in module_from_spec
File “”, line 903, in create_module
File “”, 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 “C:\Program Files\Python 3.5\lib\site-packages\tensorflow\python\pywrap_tensorflow.py”, line 41, in
from tensorflow.python.pywrap_tensorflow_internal import *
File “C:\Program Files\Python 3.5\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py”, line 21, in
_pywrap_tensorflow_internal = swig_import_helper()
File “C:\Program Files\Python 3.5\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py”, line 20, in swig_import_helper
return importlib.import_module(‘_pywrap_tensorflow_internal’)
File “C:\Program Files\Python 3.5\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:
Traceback (most recent call last):
File “”, line 1, in
File “C:\Program Files\Python 3.5\lib\site-packages\tensorflow\__init__.py”, line 24, in
from tensorflow.python import *
File “C:\Program Files\Python 3.5\lib\site-packages\tensorflow\python\__init__.py”, line 49, in
from tensorflow.python import pywrap_tensorflow
File “C:\Program Files\Python 3.5\lib\site-packages\tensorflow\python\pywrap_tensorflow.py”, line 52, in
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File “C:\Program Files\Python 3.5\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py”, line 18, in swig_import_helper
return importlib.import_module(mname)
File “C:\Program Files\Python 3.5\lib\importlib\__init__.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 986, in _gcd_import
File “”, line 969, in _find_and_load
File “”, line 958, in _find_and_load_unlocked
File “”, line 666, in _load_unlocked
File “”, line 577, in module_from_spec
File “”, line 903, in create_module
File “”, 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 “C:\Program Files\Python 3.5\lib\site-packages\tensorflow\python\pywrap_tensorflow.py”, line 41, in
from tensorflow.python.pywrap_tensorflow_internal import *
File “C:\Program Files\Python 3.5\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py”, line 21, in
_pywrap_tensorflow_internal = swig_import_helper()
File “C:\Program Files\Python 3.5\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py”, line 20, in swig_import_helper
return importlib.import_module(‘_pywrap_tensorflow_internal’)
File “C:\Program Files\Python 3.5\lib\importlib\__init__.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ImportError: No module named ‘_pywrap_tensorflow_internal’
Failed to load the native TensorFlow runtime.
See https://www.tensorflow.org/install/install_sources#common_installation_problems
for some common reasons and solutions. Include the entire stack trace
above this error message when asking for help.

 
需要安装cudnn,但是安装后仍然提示这个问题, 无奈,上网查资料得知别人安装完以后文件名为 cudnn64_5.dll 而我的是 cudnn64_6.dll,问题应该出在 cudnn版本更新,重新安装了对应的CUDA, 问题解决

发表评论