在代码里添加下面这行代码
tf.compat.v1.disable_eager_execution()
原先的:
X = tf.placeholder("float")
Y = tf.placeholder("float")
修改为:
X = tf.compat.v1.placeholder("float")
Y = tf.compat.v1.placeholder("float")
就可以了~

在代码里添加下面这行代码
tf.compat.v1.disable_eager_execution()
原先的:
X = tf.placeholder("float")
Y = tf.placeholder("float")
修改为:
X = tf.compat.v1.placeholder("float")
Y = tf.compat.v1.placeholder("float")
就可以了~