When using
model.compile(optimizer = tf.train.AdamOptimizer(), loss = 'sparse_categorical_crossentropy', metrics=['accuracy'])
in my Jupyter Notebook the following Error pops up:
module 'tensorflow._api.v2.train' has no attribute 'AdamOptimizer'
Tensorflow Version: 2.0.0-alpha0
Do you think the only possibility is to downgrade the TF version?
AttributeError: module 'tensorflow._api.v2.train' has no attribute 'AdamOptiimizer' ! LaTeX Error: File `pgf {-}pie.sty' not found. "detail": "Method "POST" not allowed."
You can also obtain the TensorFlow version with: 1. TF 1.0: python -c "import tensorflow as tf; print (tf.GIT_VERSION, tf.VERSION)" 2.
TF 2.0: python -c "import tensorflow as tf; print (tf.version.GIT_VERSION, tf.version.VERSION)" Provide a reproducible test case that is the bare minimum necessary to generate the problem.
The correct name is RMSprop and its located under tf.keras.optimizers. Therefore, please replace TensorFlow version: v2.5.0 Thanks for contributing an answer to Stack Overflow! Please be sure to answer the question. Provide details and share your research! But avoid …
tf.train.AdamOptimizer() => tf.optimizers.Adam()
From https://www.tensorflow.org/versions/r2.0/api_docs/python/tf/optimizers
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With