import tensorflow.compat.v1 as tf
tf.disable_eager_execution()
#这两步是为了解决tensorflow2.0运行1.0的代码会报错误:“AttributeError: module ‘tensorflow’ has no attribute ‘placeholder’”
#以及tf.placeholder() is not compatible with eager execution.

Logo

汇聚全球AI编程工具,助力开发者即刻编程。

更多推荐