ImportError: DLL load failed with error code -1073741795

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

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

  

解决办法:

有人说(https://blog.youkuaiyun.com/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.youkuaiyun.com/u012193416/article/details/86301899)说的方法解决了问题:

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

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

转载于:https://www.cnblogs.com/144823836yj/p/11382056.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值