You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "D:\BERT-Relation-Extraction-main\re_main.py", line 189, in
main(data_name)
File "D:\BERT-Relation-Extraction-main\re_main.py", line 181, in main
train.train()
File "D:\BERT-Relation-Extraction-main\re_main.py", line 53, in train
output = self.model(input_ids, attention_mask, token_type_ids, labels)
File "C:\Users\mqx.conda\envs\bert2\lib\site-packages\torch\nn\modules\module.py", line 1051, in _call_impl
return forward_call(*input, **kwargs)
File "D:\BERT-Relation-Extraction-main\model.py", line 55, in forward
bert_output = self.bert(input_ids=input_ids)
File "C:\Users\mqx.conda\envs\bert2\lib\site-packages\torch\nn\modules\module.py", line 1051, in _call_impl
return forward_call(*input, **kwargs)
File "C:\Users\mqx.conda\envs\bert2\lib\site-packages\transformers\models\bert\modeling_bert.py", line 974, in forward
batch_size, seq_length = input_shape
ValueError: not enough values to unpack (expected 2, got 1)
大佬,请问在训练关系抽取模型时会报这个错是什么原因呢
The text was updated successfully, but these errors were encountered:
Traceback (most recent call last):
File "D:\BERT-Relation-Extraction-main\re_main.py", line 189, in
main(data_name)
File "D:\BERT-Relation-Extraction-main\re_main.py", line 181, in main
train.train()
File "D:\BERT-Relation-Extraction-main\re_main.py", line 53, in train
output = self.model(input_ids, attention_mask, token_type_ids, labels)
File "C:\Users\mqx.conda\envs\bert2\lib\site-packages\torch\nn\modules\module.py", line 1051, in _call_impl
return forward_call(*input, **kwargs)
File "D:\BERT-Relation-Extraction-main\model.py", line 55, in forward
bert_output = self.bert(input_ids=input_ids)
File "C:\Users\mqx.conda\envs\bert2\lib\site-packages\torch\nn\modules\module.py", line 1051, in _call_impl
return forward_call(*input, **kwargs)
File "C:\Users\mqx.conda\envs\bert2\lib\site-packages\transformers\models\bert\modeling_bert.py", line 974, in forward
batch_size, seq_length = input_shape
ValueError: not enough values to unpack (expected 2, got 1)
大佬,请问在训练关系抽取模型时会报这个错是什么原因呢
The text was updated successfully, but these errors were encountered: