odule 'tensorflow._api.v2.train' has no attribute 'GradientDescentOptimizer' 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: AttributeError: module 'tensorflow._api.v2.train' has no attribute 'GradientDescentOptimizer'
Use version for the TensorFlow 2.x:
tf.optimizers.SGD (learning_rate=0.001, name='SGD')