importError:dll load failed with error code

importError:dll load failed with error code

出现问题的缘由:在cup是奔腾处理器的win7系统上安装TensorFlow1.14.0环境。是通过pip安装的,在安装过程中没有报错,最后显示的都是成功安装,导入numpy没有问题,但是导入import tensorflow as tf时就出现importError:dll load failed with error code问题。在网上查到查了很久,也反复卸载,安装等。

总结一下:

        最大的问题应该是版本问题,TensorFlow版本过高,或过低。在网上查询到信息绝大部分是认为版本过高,而我本人也是尝试向这个方向去改,从1.14.0到1.12.0又到1.14.0等等,反复安装,也没有解决这个问题。后来也是死马当活马医,将TensorFlow改成1.15.0,这个问题解决了,虽然还是报错了,但是这个错误(FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecate)比较简单,降低一下numpy版本就能行了。最后就成功了。

        在反复安装过程中也尝试其他办法,修改numpy版本,查看电脑cup是否支持TensorFlow(毕竟是奔腾系列),尝试定位到底是哪个dll,以及预装vs15等等。导致出现这样的问题原因有很多,不同电脑,不同操作会有不同原因。这里有一个排查的方向,最先检测numpy版本是否过高或过低,其次检测TensorFlow版本是否过高,当然也要试试是否过低(不要像我这样折腾,本来简单的问题搞得那么复杂),再次就是查看自己电脑cup或者系统是否支持TensorFlow了(这个原因应该比较少见,如果电脑cup型号低或者系统版本比较低,比如奔腾,win7,需要注意一下),如果还没有解决,那就自己瞎折腾吧,死马当活马医了。

        如果是出现这样的错误:

ImportError: DLL load failed with error code -1073741795
那就要小心了,极有可能是CPU不支持avx指令,那就很麻烦。要么装tensorflow1.6版本以下,或者自己编译?也可以试试这个方法。
 

I try to run the keras codes with tensorflow backend. But it caused "ImportError: DLL load failed with error code 3221225501". It seems not sloved by others..

I just install python 3.7.4 in CPU enviroment and install the tensorflow with edition:tensorflow-1.13.1-cp37-cp37m-win_amd64.whl. And it is sucessfully installed. When I run my code, errors occours: ImportError: DLL load failed with error code 3221225501. I search the problem on internet, and lower down the tensorflow edition with 1.12.0 and download the files from github. It seems useless. So I come here for help. Hope someone can provide a good suggestion, thanks in advance!

python tensorflow keras

share  improve this question  follow 

asked Aug 30 '19 at 2:58 

lmw0320

333 bronze badges

add a comment

1 Answer

ActiveOldestVotes

0

Please check if your CPU supports AVX Instructions.

If it does not support AVX instructions, then you should use TF version 1.5 or earlier versions.

From TF 1.6 and above, TF binaries uses AVX instructions.

Please refer to below link for more information.

Issue installing Tensorflow -- not a CUDA/CuDNN issue

猜你喜欢

转载自blog.csdn.net/baidu_41617231/article/details/107626186