【TensorFlow学习笔记】Keras 的安装与兼容性问题

直接在Anaconda环境中activate tensorflow,然后直接输入pip install --upgrade keras后,运行会出现ImportError:cannot import name 'tf_utils’的问题,主要是因为 Keras 和 Tensorflow 的版本不兼容。
在这里插入图片描述

解决方法是将pip install --upgrade kera改为pip install --upgrade kera==2.0.8,这里的环境配置为:tensorflow 1.4.0,keras 2.0.8,实验结果恢复了正常。

在这里插入图片描述在这里插入图片描述
参考的Keras和Tensorflow版本之间兼容性的链接

在配置环境和调用库的时候,需要注意库之间、与环境之间版本与API的兼容性。特别地,cuda版本、cudnn版本、tensorflow版本等。

发布了28 篇原创文章 · 获赞 2 · 访问量 2820

猜你喜欢

转载自blog.csdn.net/Jarvis_lele/article/details/104218125
今日推荐