Open ChildishChange opened 2 years ago
try this: https://deepctr-doc.readthedocs.io/en/latest/FAQ.html#set-learning-rate-and-use-earlystopping
also failed, XP
# ImportError: cannot import name 'Adam' from 'tensorflow.python.keras.optimizers' (/root/miniconda3/envs/py3_tf2/lib/python3.8/site-packages/tensorflow/python/keras/optimizers.py)
from tensorflow.python.keras.optimizers import Adam,Adagrad
Tensorflow 2.10.0版本
from tensorflow.python.keras.optimizers import adam_v2
adam=adam_v2.Adam()
print(adam)
print(adam.get_config())
# <tensorflow.python.keras.optimizer_v2.adam.Adam object at 0x1011329d0>
# {'name': 'Adam', 'learning_rate': 0.001, 'decay': 0.0, 'beta_1': 0.9, 'beta_2': 0.999, 'epsilon': 1e-07, 'amsgrad': False}
from tensorflow.python.keras.optimizers import Adam
adam_old=Adam()
print(adam_old)#ImportError: cannot import name 'Adam' from 'tensorflow.python.keras.optimizers'
print(adam_old.get_config())
model.compile(optimizer='adam', loss=tf.keras.losses.BinaryCrossentropy(), metrics=metrics)
This works for me
Describe the bug(问题描述) get a valueError when running deepfm demo
To Reproduce(复现步骤)
Operating environment(运行环境):
Additional context
solution may be: https://stackoverflow.com/questions/70658010/could-not-interpret-optimizer-identifier-formatidentifier