zoukankan      html  css  js  c++  java
  • ImportError: DLL load failed with error code -1073741795

    Win7,python3.6,pip安装tensorflow之后报错:

    >>> import tensorflow
    Traceback (most recent call last):
      File "D:AppSetPlacepython36libsite-packages	ensorflowpythonpywrap_tenso
    rflow.py", line 58, in <module>
        from tensorflow.python.pywrap_tensorflow_internal import *
      File "D:AppSetPlacepython36libsite-packages	ensorflowpythonpywrap_tenso
    rflow_internal.py", line 28, in <module>
        _pywrap_tensorflow_internal = swig_import_helper()
      File "D:AppSetPlacepython36libsite-packages	ensorflowpythonpywrap_tenso
    rflow_internal.py", line 24, in swig_import_helper
        _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, descript
    ion)
      File "D:AppSetPlacepython36libimp.py", line 242, in load_module
        return load_dynamic(name, filename, file)
      File "D:AppSetPlacepython36libimp.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 "D:AppSetPlacepython36libsite-packages	ensorflow\__init__.py", line
    28, in <module>
        from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-im
    port
      File "D:AppSetPlacepython36libsite-packages	ensorflowpython\__init__.py"
    , line 49, in <module>
        from tensorflow.python import pywrap_tensorflow
      File "D:AppSetPlacepython36libsite-packages	ensorflowpythonpywrap_tenso
    rflow.py", line 74, in <module>
        raise ImportError(msg)
    ImportError: Traceback (most recent call last):
      File "D:AppSetPlacepython36libsite-packages	ensorflowpythonpywrap_tenso
    rflow.py", line 58, in <module>
        from tensorflow.python.pywrap_tensorflow_internal import *
      File "D:AppSetPlacepython36libsite-packages	ensorflowpythonpywrap_tenso
    rflow_internal.py", line 28, in <module>
        _pywrap_tensorflow_internal = swig_import_helper()
      File "D:AppSetPlacepython36libsite-packages	ensorflowpythonpywrap_tenso
    rflow_internal.py", line 24, in swig_import_helper
        _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, descript
    ion)
      File "D:AppSetPlacepython36libimp.py", line 242, in load_module
        return load_dynamic(name, filename, file)
      File "D:AppSetPlacepython36libimp.py", line 342, in load_dynamic
        return _load(spec)
    ImportError: DLL load failed with error code -1073741795
    

      

    解决办法:

    有人说(https://blog.csdn.net/fhqlongteng/article/details/80279197)是CPU太老了,我也不太懂CPU,但安装他说的办法:

      问题的原因是我的电脑(联想V460)的cpu比较老,不支持AVX指令导致的,需要安装特殊编译的tensorflow 1.6.0版本才可以解决,注意安装时要先卸载先前安装的1.8.0版本。关于这个问题的详细解决过程可以参考github上面tensorflow的论坛

    问题解决了。

    安装上面说的版本之后还可能出现一个错误:

    from google.protobuf.pyext import _message,使用tensorflow出现 ImportError: DLL load failed

    按照这篇博客(https://blog.csdn.net/u012193416/article/details/86301899)说的方法解决了问题:

     在自动安装了tensorflow时, protobuf安装的是最新版本3.6.1, 出现了不兼容的问题。

    更换为 protobuf 3.6.0即可(pip install protobuf==3.6.0)

  • 相关阅读:
    csv大文件分割以及添加表头
    菜鸟装机大杂烩
    CENTOS 基础指令——查看系统环境
    centos使用163 yum源
    MySQL my.cnf参数配置优化详解
    phpcms 实现动态价格
    phpcms模块开发中的小问题及解决方法
    关于v9缓存的那点事
    nvm-windows 手动安装 nvm use 无效 'node' 不是内部或外部命令,也不是可运行的程序
    最新eclipse国内镜像站,比ustc等站点资源新。
  • 原文地址:https://www.cnblogs.com/144823836yj/p/11382056.html
Copyright © 2011-2022 走看看