【问题标题】:Tensorflow-gpu on windows: ImportError: No module named _pywrap_tensorflowWindows 上的 TensorFlow-gpu:ImportError: No module named _pywrap_tensorflow
【发布时间】:2017-07-08 17:51:34
【问题描述】:

当我尝试import tensorflow 时,我收到以下错误:

>>import tensorflow
  File "C:\Users\...\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\__init__.py", line 24, in <module>
    from tensorflow.python import *
  File "C:\Users\...\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\__init__.py", line 72, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "C:\Users\...\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\__init__.py", line 66, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "C:\Users\...\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 21, in <module>
    _pywrap_tensorflow = swig_import_helper()
  File "C:\Users\...\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 20, in swig_import_helper
    return importlib.import_module('_pywrap_tensorflow')
  File "C:\Users\...\Anaconda3\envs\tensorflow\lib\importlib\__init__.py", line 37, in import_module
    __import__(name)
ImportError: No module named _pywrap_tensorflow


Failed to load the native TensorFlow runtime.

See https://github.com/tensorflow/tensorflow/blob/master/tensorflow/g3doc/get_started/os_setup.md#import_error

for some common reasons and solutions.  Include the entire stack trace
above this error message when asking for help.

我按照推荐的here 安装了msvcp140.dll Redistributable,但没有帮助。有任何想法吗?我正在运行Anaconda3 环境。

【问题讨论】:

标签: python windows tensorflow anaconda


【解决方案1】:

原来windows 上的tensorflow 需要python 3.5 或更高版本,而我的python 是2.7.8。在这个伟大的script 的帮助下,我发现这是问题所在,它有助于追踪源错误并给出清晰的错误消息。

【讨论】:

    猜你喜欢
    • 2017-06-20
    • 1970-01-01
    • 2018-10-28
    • 2017-05-30
    • 2016-04-27
    • 2018-06-23
    • 1970-01-01
    • 2021-02-04
    • 2021-07-17
    相关资源
    最近更新 更多