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
换一个电脑之后运行main.py报错:
Traceback (most recent call last):
File "G:/BERT-Relation-Extraction/BERT-Relation-Extraction/ner_main.py", line 190, in
main(data_name)
File "G:/BERT-Relation-Extraction/BERT-Relation-Extraction/ner_main.py", line 182, in main
train.train()
File "G:/BERT-Relation-Extraction/BERT-Relation-Extraction/ner_main.py", line 52, in train
output = self.model(input_ids, attention_mask, labels)
File "C:\ProgramData\Anaconda3\envs\pytorchpy38_gpu_cuda111\lib\site-packages\torch\nn\modules\module.py", line 1051, in _call_impl
return forward_call(*input, **kwargs)
File "G:\BERT-Relation-Extraction\BERT-Relation-Extraction\model.py", line 37, in forward
loss = -self.crf(seq_out, labels, mask=attention_mask.bool(), reduction='mean')
File "C:\ProgramData\Anaconda3\envs\pytorchpy38_gpu_cuda111\lib\site-packages\torch\nn\modules\module.py", line 1051, in call_impl
return forward_call(*input, **kwargs)
File "C:\ProgramData\Anaconda3\envs\pytorchpy38_gpu_cuda111\lib\site-packages\torchcrf_init.py", line 102, in forward
numerator = self.compute_score(emissions, tags, mask)
File "C:\ProgramData\Anaconda3\envs\pytorchpy38_gpu_cuda111\lib\site-packages\torchcrf_init.py", line 186, in _compute_score
score = self.start_transitions[tags[0]]
IndexError: tensors used as indices must be long, byte or bool tensors
请问大佬知道原因吗? TAT
The text was updated successfully, but these errors were encountered:
换一个电脑之后运行main.py报错:
Traceback (most recent call last):
File "G:/BERT-Relation-Extraction/BERT-Relation-Extraction/ner_main.py", line 190, in
main(data_name)
File "G:/BERT-Relation-Extraction/BERT-Relation-Extraction/ner_main.py", line 182, in main
train.train()
File "G:/BERT-Relation-Extraction/BERT-Relation-Extraction/ner_main.py", line 52, in train
output = self.model(input_ids, attention_mask, labels)
File "C:\ProgramData\Anaconda3\envs\pytorchpy38_gpu_cuda111\lib\site-packages\torch\nn\modules\module.py", line 1051, in _call_impl
return forward_call(*input, **kwargs)
File "G:\BERT-Relation-Extraction\BERT-Relation-Extraction\model.py", line 37, in forward
loss = -self.crf(seq_out, labels, mask=attention_mask.bool(), reduction='mean')
File "C:\ProgramData\Anaconda3\envs\pytorchpy38_gpu_cuda111\lib\site-packages\torch\nn\modules\module.py", line 1051, in call_impl
return forward_call(*input, **kwargs)
File "C:\ProgramData\Anaconda3\envs\pytorchpy38_gpu_cuda111\lib\site-packages\torchcrf_init.py", line 102, in forward
numerator = self.compute_score(emissions, tags, mask)
File "C:\ProgramData\Anaconda3\envs\pytorchpy38_gpu_cuda111\lib\site-packages\torchcrf_init.py", line 186, in _compute_score
score = self.start_transitions[tags[0]]
IndexError: tensors used as indices must be long, byte or bool tensors
请问大佬知道原因吗? TAT
The text was updated successfully, but these errors were encountered: