CasRel icon indicating copy to clipboard operation
CasRel copied to clipboard

get_encoders() got an unexpected keyword argument 'use_adapter'

Open fb1018 opened this issue 4 years ago • 3 comments

Traceback (most recent call last): File "run.py", line 40, in subject_model, object_model, hbt_model = E2EModel(bert_config_path, bert_checkpoint_path, LR, num_rels) File "/home/fubo01/work/paper/CasRel/CasRel-master/model.py", line 15, in E2EModel bert_model = load_trained_model_from_checkpoint(bert_config_path, bert_checkpoint_path, seq_len=None) File "/home/fubo01/miniconda3/envs/CasRel/lib/python3.7/site-packages/keras_bert/loader.py", line 169, in load_trained_model_from_checkpoint **kwargs) File "/home/fubo01/miniconda3/envs/CasRel/lib/python3.7/site-packages/keras_bert/loader.py", line 58, in build_model_from_config **kwargs) File "/home/fubo01/miniconda3/envs/CasRel/lib/python3.7/site-packages/keras_bert/bert.py", line 126, in get_model adapter_activation=gelu, TypeError: get_encoders() got an unexpected keyword argument 'use_adapter'

fb1018 avatar Feb 20 '21 16:02 fb1018

please release your requirements.txt!!!! OK ?

fb1018 avatar Feb 20 '21 16:02 fb1018

please release your requirements.txt!!!! OK ?

I solved this problem by installing keras-transformer==0.30.0 via pip.

jiaruncao avatar Mar 18 '21 08:03 jiaruncao

pip install keras_bert==0.81.1

GoodDayUp avatar Aug 10 '21 14:08 GoodDayUp