Windows上的Tensorflow-gpu:ImportError:没有名为_pywrap_tensorflow的模块

时间:2017-07-08 17:51:35

标签: python windows tensorflow anaconda

当我尝试body { background:Red ; } 时,我收到以下错误:

import tensorflow

我按照推荐的here安装了>>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. ,但它没有帮助。有任何想法吗?我正在运行msvcp140.dll Redistributable环境。

1 个答案:

答案 0 :(得分:0)

事实证明,tensorflow上的windows需要python 3.5或更高,而我的python是2.7.8。我发现这是在这个伟大的script的帮助下的问题,它有助于跟踪源错误并提供明确的错误消息。