AttributeError: module 'tensorflow._api.v2.train' has no attribute 'GradientDescentOptimizer' site:stackoverflow.com code example
Example 1: AttributeError: module 'tensorflow._api.v2.train' has no attribute 'GradientDescentOptimizer' site:stackoverflow.com
use tf.optimizer.SGD() for tensorflow2.0
Example 2: tensorflow_core._api.v2.train' has no attribute 'GradientDescentOptimizer'
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()