解决TensorFlow2.0中AttributeError: module ‘tensorflow._api.v2.train’ has no attribute ‘GradientDescentOptimizer’
tf.compat.v1.disable_eager_execution()
tf.compat.v1.train.GradientDescentOptimizer(0.5)
解决TensorFlow2.0中AttributeError: module ‘tensorflow._api.v2.train’ has no attribute ‘GradientDescentOptimizer’
tf.compat.v1.disable_eager_execution()
tf.compat.v1.train.GradientDescentOptimizer(0.5)