addons icon indicating copy to clipboard operation
addons copied to clipboard

optimizers.MovingAverage not working with tf2.11

Open Ianni opened this issue 2 years ago • 4 comments

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Ubuntu 22.04
  • TensorFlow version and how it was installed (source or binary): 2.11 pip wheel
  • TensorFlow-Addons version and how it was installed (source or binary): 0.19 pip
  • Python version: 3.9
  • Is GPU used? (yes/no): yes

Describe the bug

Using moving average of optimizers is no longer working and results in

TypeError: optimizer is not an object of tf.keras.optimizers.Optimizer or tf.keras.optimizers.legacy.Optimizer (if you have tf version >= 2.11.0).

Code to reproduce the issue

Compare e.g. the example notebook from the documentation: https://www.tensorflow.org/addons/tutorials/average_optimizers_callback

Note: if you try it in collab, you have to install tf2.11 first.

Other info / logs

See also https://www.tensorflow.org/addons/api_docs/python/tfa/optimizers/MovingAverage

Ianni avatar Jan 09 '23 14:01 Ianni