TensorFlow随笔-生活工作点滴

Tensorflow版本冲突问题: AttributeError

2019-07-09  本文已影响6人  正在学习的Yuki

用 tensorflow-gpu 2.0.0-beta1 跑程序时出现错误

错误 Error

AttributeError: module 'tensorflow' has no attribute 'keras'

相关代码 Code

content_path = tf.keras.utils.get_file('turtle.jpg','https://storage.googleapis.com/download.tensorflow.org/example_images/Green_Sea_Turtle_grazing_seagrass.jpg')

原因 Reason

tensorflow版本冲突,因为环境中还装了tensorflow1.13版本
tf.keras 需要1.14及以上的版本

解决方法 Solution

Reference: https://github.com/tensorflow/tensorflow/issues/16614

上一篇 下一篇

猜你喜欢

热点阅读