Unverified Commit d0bfdd20 authored by Matt's avatar Matt Committed by GitHub
Browse files

TF AdamWeightDecay fix for 2.11 (#20848)

* Fix incorrect import for the base optimizer for AdamWeightDecay

* Fix incorrect import for the base optimizer for AdamWeightDecay
parent d1d3ac94
...@@ -21,10 +21,10 @@ from typing import Callable, List, Optional, Union ...@@ -21,10 +21,10 @@ from typing import Callable, List, Optional, Union
import tensorflow as tf import tensorflow as tf
if hasattr(tf.keras, "optimizer") and hasattr(tf.keras.optimizer, "legacy"): try:
Adam = tf.keras.optimizer.legacy.Adam from tensorflow.keras.optimizers.legacy import Adam
else: except ImportError:
Adam = tf.keras.optimizers.Adam from tensorflow.keras.optimizers import Adam
class WarmUp(tf.keras.optimizers.schedules.LearningRateSchedule): class WarmUp(tf.keras.optimizers.schedules.LearningRateSchedule):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment