bert_crf icon indicating copy to clipboard operation
bert_crf copied to clipboard

Error

Open Astudnew opened this issue 4 years ago • 0 comments

Hi I clone your repo on google colab to run it At the beginning I get an error that torchcrf module not found but after I install pytorch-crf (!pip install pytorch-crf==0.4.0) it works , but I get other errors : "Traceback (most recent call last): File "bert_crf.py", line 433, in t_loss, v_loss = train(train_iter, eval_iter, tag2idx, config=config, bert_model=config.bert_model) File "bert_crf.py", line 196, in train model = Bert_CRF.from_pretrained(bert_model, num_labels = len(tag2idx)) File "/usr/local/lib/python3.6/dist-packages/transformers/modeling_utils.py", line 1034, in from_pretrained model = cls(config, *model_args, **model_kwargs) File "bert_crf.py", line 141, in init self.crf = CRF(self.num_labels, batch_first=True)
TypeError: init() got an unexpected keyword argument 'batch_firs" how I can fix them?

Astudnew avatar Jan 18 '21 20:01 Astudnew