I am trying to learn BERT with R. I loaded "reticulate" and use reticulate::py_install to install keras-bert. Then a line of code k_bert = import('keras_bert') was run successfully. However, when trying with
model %>% compile(
k_bert$AdamWarmup(decay_steps=decay_steps,
warmup_steps=warmup_steps, learning_rate=learning_rate),
loss = 'binary_crossentropy',
metrics = 'accuracy'
)
where decay_steps = 29, warmup_steps = 2, learning_rate = 1 e-04
The example code calls warmup_v2.py which is located in the following directory:
Library/r-miniconda/envs/r-reticulate/lib/python3.9/site-packages/keras_bert/optimizers/warmup_v2.py
and throws errors:
Error in py_call_impl(callable, call_args$unnamed, call_args$named) :
AttributeError: 'AdamWarmup' object has no attribute '_set_hyper'
Traceback detail takes me to the warmup_v2.py script.
I am using Mac OS 12.6.3
R 4.3.1
keras_bert 0.89.0
Thank you in advance.
A clear and concise description of what the bug is.
Version Info
Minimal Codes To Reproduce