TensorFlow2.1.0版本运行程序报错
AttributeError: module 'tensorflow_core._api.v2.train' has no attribute 'GradientDescentOptimizer'
解决办法:
import tensorflow as tf
改为
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
TensorFlow2.1.0版本运行程序报错
AttributeError: module 'tensorflow_core._api.v2.train' has no attribute 'GradientDescentOptimizer'
解决办法:
import tensorflow as tf
改为
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()