【问题标题】:Tensorflow CPU Version installation error (DLL load fail) Win7, Python 3.5.0Tensorflow CPU版本安装错误(DLL加载失败) Win7, Python 3.5.0
【发布时间】:2019-07-12 09:07:05
【问题描述】:

为此苦苦挣扎了 3 天。我已经有 tensorflow 在其他 3 台机器上工作,但需要在未来的高性能 CPU 上安装它。 尝试使用 pip 安装 tensorflow 时出现以下 DLL 导入错误。

处理器:Intel(R) Xeon(R) CPU 系统类型:64位 基于我已经尝试过的其他解决方案

已按照 Tensorflow 安装页面上的所有说明进行操作

  • 已安装 Microsoft Visual C++ 2015 Redistributable Update
  • 在安装多个 Anaconda 版本后尝试使用 Conda 包
  • 尝试了一些替代的 [whl][1],因为我在 AVX2 中找不到我的 CPU CPU 列表
  • 尝试了多个单独的版本(Python 3.5、3.6、tensorflow 1.12.0、1.9.0、1.6.0 等)(即没有 anaconda)

pywrap_tensorflow_internal 导入

ImportError:DLL 加载失败,错误代码为 -1073741795

============================= (venv)

c:\software\Python35\venv\Lib\site-packages>echo %Path%

c:\software\Python35\venv\Scripts;C:\Windows\system32;C:\Windows;C:\Windows\
System32\Wbem;C:\software\Python35;C:\software\Python35\venv\Lib\site-packages;
C:\software\Python35\venv\Lib\site-packages\tensorflow\include\tensorflow;C:\software\curl


(venv) c:\software\Python35>pip show tensorflow
Name: tensorflow
Version: 1.12.0
Summary: TensorFlow is an open source machine learning framework for everyone.
Home-page: https://www.tensorflow.org/
Author: Google Inc.
Author-email: opensource@google.com
License: Apache 2.0
Location: c:\software\python35\venv\lib\site-packages
Requires: termcolor, grpcio, keras-preprocessing, wheel, absl-py, six, numpy, ke
ras-applications, astor, tensorboard, protobuf, gast
Required-by:

(venv) c:\software\Python35>cd c:\software\python35\venv\lib\site-packag
es

(venv) c:\software\Python35\venv\Lib\site-packages>python
Python 3.5.0 (v3.5.0:374f501f4567, Sep 13 2015, 02:27:37) [MSC v.1900 64 bit (AM
D64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow
Traceback (most recent call last):
  File "c:\software\Python35\venv\Lib\site-packages\tensorflow\python\pywrap
_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "c:\software\Python35\venv\Lib\site-packages\tensorflow\python\pywrap
_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "c:\software\Python35\venv\Lib\site-packages\tensorflow\python\pywrap
_tensorflow_internal.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, descript
ion)
  File "c:\software\Python35\venv\lib\imp.py", line 242, in load_module
    return load_dynamic(name, filename, file)
  File "c:\software\Python35\venv\lib\imp.py", line 342, in load_dynamic
    return _load(spec)
ImportError: DLL load failed with error code -1073741795

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "c:\software\Python35\venv\Lib\site-packages\tensorflow\__init__.py",
 line 24, in <module>
    from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-im
port
  File "c:\software\Python35\venv\Lib\site-packages\tensorflow\python\__init
__.py", line 49, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "c:\software\Python35\venv\Lib\site-packages\tensorflow\python\pywrap
_tensorflow.py", line 74, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "c:\software\Python35\venv\Lib\site-packages\tensorflow\python\pywrap
_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "c:\software\Python35\venv\Lib\site-packages\tensorflow\python\pywrap
_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "c:\software\Python35\venv\Lib\site-packages\tensorflow\python\pywrap
_tensorflow_internal.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, descript
ion)
  File "c:\software\Python35\venv\lib\imp.py", line 242, in load_module
    return load_dynamic(name, filename, file)
  File "c:\software\Python35\venv\lib\imp.py", line 342, in load_dynamic
    return _load(spec)
ImportError: DLL load failed with error code -1073741795


Failed to load the native TensorFlow runtime.

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

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

【问题讨论】:

    标签: windows tensorflow installation python-3.5


    【解决方案1】:

    尝试安装 Python 3.6.0 和 Tensorflow 1.5.0。收到“google.protobuf.pyext import _message”错误。所以按照this我升级到3.6.1。我现在可以导入张量流了!所以看起来我必须使用 tensorflow 1.5.0 版本

    【讨论】:

      猜你喜欢
      • 2020-06-02
      • 2018-08-13
      • 2017-10-19
      • 2011-08-25
      • 2021-07-19
      • 2019-01-09
      • 2011-05-03
      • 2018-08-09
      • 1970-01-01
      相关资源
      最近更新 更多