这是由于tensorflow版本过高所致,为了兼容之前版本的运算,加入语句:tf.enable_eager_execution()
import tensorflow as tf
tf.enable_eager_execution() # 关键
这是由于tensorflow版本过高所致,为了兼容之前版本的运算,加入语句:tf.enable_eager_execution()
import tensorflow as tf
tf.enable_eager_execution() # 关键