导入Keras、TensorFlow 时出现:Failed to load the native TensorFlow runtime.

背景及环境介绍:重装了系统,发现使用TensorFlow时出现了Failed to load the native TensorFlow runtime. 

目前环境:win10 、anaconda 、python3.6 、TensorFlow—CPU

罗列一下博客以及Stack Overflow上的解答:

部分参考来自这里,但是上述均没有解决我的问题。经过一系列的摸索得出解决方案:

1、先使用conda upgrade --all 升级所有的包

2、使用Python -m pip install --upgrade pip 或者conda upgrade pip升级pip工具

3、使用conda install tensorflow 安装(因为pip install TensorFlow安装成功,但是import一直会出现上述问题,虽然TF不对conda上的TF进行维护,但是目前TF1.2版本的已经够用了)

4、完成上一步之后就有了TensorFlow的backend,在使用pip install keras 或者conda install keras均可

上述问题解决

猜你喜欢

转载自blog.csdn.net/herr_kun/article/details/80448861