Dan Dinh
Dan Dinh

Reputation: 8629

What can be used to replace tf.train.GradientDescentOptimizer in TensorFlow 2

I'm trying to convert my TensorFlow 1.4 code to TensorFlow 2 but in there's no more tf.train.GradientDescentOptimizer in TF 2.

What should be the replacement for tf.train.GradientDescentOptimizer?

I found the same thing in tf.compat.v1.train. but I shouldn't use it as those stuff in tf.compat will be removed sooner or later.

Upvotes: 5

Views: 8144

Answers (1)

Rishabh Sahrawat
Rishabh Sahrawat

Reputation: 2507

You can replace it with, tf.keras.optimizers.SGD() defined here. Here (skip to third point) is the official message, where TF team mentioned to use this keras optimizer.

Upvotes: 8

Related Questions