lsbt022 2018-11-05 14:09 采纳率: 80%
浏览 7083
已采纳

ImportError: No module named '_pywrap_tensorflow_internal'

tensorflow==1.5.0 安装成功;继续安装gpu版本,按系统提示再安装 CUDA-9.0, cuDNN-7.0: cuda_9.0.176_win10_network以及patch1-4 / cudnn-9.0-windows10-x64-v7.3.1.20. 运行‘import tensorflow as tf’后报错: ImportError: No module named '_pywrap_tensorflow_internal'

谢谢帮助

            ---------------------------------------------------------------------------

ImportError Traceback (most recent call last)
C:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py in swig_import_helper()
17 try:
---> 18 return importlib.import_module(mname)
19 except ImportError:

C:\Program Files\Anaconda3\lib\importlib__init__.py in import_module(name, package)
125 level += 1
--> 126 return _bootstrap._gcd_import(name[level:], package, level)
127

C:\Program Files\Anaconda3\lib\importlib_bootstrap.py in _gcd_import(name, package, level)

C:\Program Files\Anaconda3\lib\importlib_bootstrap.py in find_and_load(name, import)

C:\Program Files\Anaconda3\lib\importlib_bootstrap.py in find_and_load_unlocked(name, import)

C:\Program Files\Anaconda3\lib\importlib_bootstrap.py in _load_unlocked(spec)

C:\Program Files\Anaconda3\lib\importlib_bootstrap.py in module_from_spec(spec)

C:\Program Files\Anaconda3\lib\importlib_bootstrap_external.py in create_module(self, spec)

C:\Program Files\Anaconda3\lib\importlib_bootstrap.py in _call_with_frames_removed(f, *args, **kwds)

ImportError: DLL load failed: 找不到指定的程序。

During handling of the above exception, another exception occurred:

ImportError Traceback (most recent call last)
C:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py in ()
57
---> 58 from tensorflow.python.pywrap_tensorflow_internal import *
59 from tensorflow.python.pywrap_tensorflow_internal import version

C:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py in ()
20 return importlib.import_module('_pywrap_tensorflow_internal')
---> 21 _pywrap_tensorflow_internal = swig_import_helper()
22 del swig_import_helper

C:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py in swig_import_helper()
19 except ImportError:
---> 20 return importlib.import_module('_pywrap_tensorflow_internal')
21 _pywrap_tensorflow_internal = swig_import_helper()

C:\Program Files\Anaconda3\lib\importlib__init__.py in import_module(name, package)
125 level += 1
--> 126 return _bootstrap._gcd_import(name[level:], package, level)
127

ImportError: No module named '_pywrap_tensorflow_internal'

During handling of the above exception, another exception occurred:

ImportError Traceback (most recent call last)
in ()
----> 1 import tensorflow as tf

C:\Program Files\Anaconda3\lib\site-packages\tensorflow__init__.py in ()
22
23 # pylint: disable=wildcard-import
---> 24 from tensorflow.python import *
25 # pylint: enable=wildcard-import
26

C:\Program Files\Anaconda3\lib\site-packages\tensorflow\python__init__.py in ()
47 import numpy as np
48
---> 49 from tensorflow.python import pywrap_tensorflow
50
51 # Protocol buffers

C:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py in ()
72 for some common reasons and solutions. Include the entire stack trace
73 above this error message when asking for help.""" % traceback.format_exc()
---> 74 raise ImportError(msg)
75
76 # pylint: enable=wildcard-import,g-import-not-at-top,unused-import,line-too-long

ImportError: Traceback (most recent call last):
File "C:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in swig_import_helper
return importlib.import_module(mname)
File "C:\Program Files\Anaconda3\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 906, 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\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 21, in
pywrap_tensorflow_internal = swig_import_helper()
File "C:\Program Files\Anaconda3\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\Anaconda3\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.

  • 写回答

2条回答 默认 最新

  • threenewbee 2018-11-05 15:45
    关注

    什么叫做“tensorflow==1.5.0 安装成功;继续安装gpu版本”
    tf分为cpu版本和gpu版本,如果你要装gpu版本,没必要装cpu版本,你装了cpu版本成功,不代表你装对了gpu版本。
    既然报错了,应该是你tensorflow-gpu没有安装对,用pip install tensorflow-gpu安装下。

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 如何用stata画出文献中常见的安慰剂检验图
  • ¥15 c语言链表结构体数据插入
  • ¥40 使用MATLAB解答线性代数问题
  • ¥15 COCOS的问题COCOS的问题
  • ¥15 FPGA-SRIO初始化失败
  • ¥15 MapReduce实现倒排索引失败
  • ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
  • ¥15 找一位技术过硬的游戏pj程序员
  • ¥15 matlab生成电测深三层曲线模型代码
  • ¥50 随机森林与房贷信用风险模型