question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: get_encoders() got an unexpected keyword argument 'use_adapter'

See original GitHub issue
import os
from keras_bert import load_trained_model_from_checkpoint

layer_num = 12
checkpoint_path = 'rubert_cased_L-12_H-768_A-12_v1'

config_path = os.path.join(checkpoint_path, 'bert_config.json')
model_path = os.path.join(checkpoint_path, 'bert_model.ckpt')
model = load_trained_model_from_checkpoint(
    config_path,
    model_path,
    training=False,
    use_adapter=True,
    trainable=['Encoder-{}-MultiHeadSelfAttention-Adapter'.format(i + 1) for i in range(layer_num)] +
    ['Encoder-{}-FeedForward-Adapter'.format(i + 1) for i in range(layer_num)] +
    ['Encoder-{}-MultiHeadSelfAttention-Norm'.format(i + 1) for i in range(layer_num)] +
    ['Encoder-{}-FeedForward-Norm'.format(i + 1) for i in range(layer_num)],
)

I try to run this code from tutorial and this error arises:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-23-a18dfbad0880> in <module>
     15     ['Encoder-{}-FeedForward-Adapter'.format(i + 1) for i in range(layer_num)] +
     16     ['Encoder-{}-MultiHeadSelfAttention-Norm'.format(i + 1) for i in range(layer_num)] +
---> 17     ['Encoder-{}-FeedForward-Norm'.format(i + 1) for i in range(layer_num)],
     18 )

TypeError: load_trained_model_from_checkpoint() got an unexpected keyword argument 'use_adapter'

By the way, i tried to upgrade keras-transformers - it didnt help

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
CyberZHGcommented, Aug 3, 2019
pip install --upgrade keras-bert
0reactions
apugachevcommented, Mar 14, 2021

Try pip install keras-transformer==0.33.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

python - TypeError: __init__() got an unexpected keyword ...
Here's the complete code that I was able to run on sklearn == 0.23.1 import pandas as pd from sklearn.compose import ColumnTransformer from ......
Read more >
Unexpected keyword argument - Anvil Q&A
TypeError : notify_burned() got an unexpected keyword argument 'customer_name' at /downlink/anvil/_server.py, line 1340.
Read more >
TypeError: __init__() got an unexpected keyword argument ...
Hi, I have followed the steps given in the chapter to set up mflix app. ... TypeError: init() got an unexpected keyword argument...
Read more >
TypeError: invoke() got an unexpected keyword argument ...
TypeError : invoke() got an unexpected keyword argument when using Verb on Orion.Accounts API ... Hi,. I am using Python and looking to...
Read more >
Error "get_file_data() got an unexpected keyword argument ...
I have configured one input using the File-Meta Data input to monitor a log file. ... TypeError: get_file_data() got an unexpected keyword argument...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found