Skip to content
This repository has been archived by the owner on Mar 3, 2024. It is now read-only.

'adamwarmup' object has no attribute '_set_hyper' #226

Open
1 task
jianlianggao opened this issue Sep 28, 2023 · 0 comments
Open
1 task

'adamwarmup' object has no attribute '_set_hyper' #226

jianlianggao opened this issue Sep 28, 2023 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@jianlianggao
Copy link

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

  • I'm using the latest version

Minimal Codes To Reproduce

import keras_bert

pass
@jianlianggao jianlianggao added the bug Something isn't working label Sep 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants