ImportError: DLL load failed with error code -1073741795
Posted Data+Science+Insight
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ImportError: DLL load failed with error code -1073741795相关的知识,希望对你有一定的参考价值。
ImportError: DLL load failed with error code -1073741795
目录
ImportError: DLL load failed with error code -1073741795
问题:
tensorflow导入发生错误
import tensorflow
Traceback (most recent call last):
File "C:\\Users\\Administrator\\venv\\lib\\site-packages\\tensorflow\\python\\pywrap_t
ensorflow.py", line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\\Users\\Administrator\\venv\\lib\\site-packages\\tensorflow\\python\\pywrap_t
ensorflow_internal.py", line 28, in
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\\Users\\Administrator\\venv\\lib\\site-packages\\tensorflow\\python\\pywrap_t
ensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, descript
ion)
File "C:\\Users\\Administrator\\venv\\lib\\imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "C:\\Users\\Administrator\\venv\\lib\\imp.py", line 343, in load_dynamic
return _load(spec)
ImportError: DLL load failed with error code -1073741795
解决:
tensorflow版本1.6及以上需要CPU包含AVX指令集。如果没有则tensorflow无法加载。
有的CPU就是没有AVX指令集,那么我们需要把tensorflow的版本降低到1.6一下。
TensorFlow release binaries version 1.6 and higher are prebuilt with AVX instruction sets.
Therefore on any CPU that does not have these instruction sets, either CPU or GPU version of TF will fail to load.
完整错误:
参考:https://github.com/tensorflow/tensorflow/issues/35409
参考:DLL load failed with error code -1073741795 Tensorflow - Stack Overflow
参考:在不支持avx指令集的cpu上部署tensorflow及keras._babytiger的博客-CSDN博客_不支持avx的cpu
以上是关于ImportError: DLL load failed with error code -1073741795的主要内容,如果未能解决你的问题,请参考以下文章
ImportError: DLL load failed with error code -1073741795
ImportError: DLL load failed: 找不到指定的模块。
Python ImportError: DLL load failed: %1 不是有效的 Win32 应用程序。
Python ImportError: DLL load failed: %1 不是有效的 Win32 应用程序。