naver/sqlova

Missing Positional Requirements

Closed this issue · 2 comments

When I run python3 train.py --seed 1 --bS 16 --accumulate_gradients 2 --bert_type_abb uS --fine_tune --lr 0.001 --lr_bert 0.00001 --max_seq_leng 222 .
I get the error
Traceback (most recent call last): File "train.py", line 582, in <module> model, model_bert, tokenizer, bert_config = get_models(args, BERT_PT_PATH, trained=True, path_model_bert=path_model_bert, path_model=path_model) File "train.py", line 156, in get_models args.no_pretraining) File "train.py", line 120, in get_bert model_bert = BertModel(bert_config) TypeError: __init__() missing 2 required positional arguments: 'is_training' and 'input_ids
I am using Python 3.6.7

Hi @ronalddas

Hm.. BertModel class does not take is_training and input_ids as arguments (see below)

sqlova/bert/modeling.py

Lines 363 to 373 in 03407da

def __init__(self, config: BertConfig):
"""Constructor for BertModel.
Args:
config: `BertConfig` instance.
"""
super(BertModel, self).__init__()
self.embeddings = BERTEmbeddings(config)
self.encoder = BERTEncoder(config)
self.pooler = BERTPooler(config)

Are you using the same BertModel class uploaded in this repository?

Wonseok

I had pre-trained-bert installed, it was calling the BertModel class from there.