BERT-BiLSTM-CRF-NER-pytorch icon indicating copy to clipboard operation
BERT-BiLSTM-CRF-NER-pytorch copied to clipboard

多GPU运行出错,

Open yysirs opened this issue 4 years ago • 2 comments

extended_attention_mask = extended_attention_mask.to(dtype=next(self.parameters()).dtype) # fp16 compatibility 卡在这语句上,感觉应该是维度不匹配的问题,应该怎么修改啊?

yysirs avatar Jan 10 '21 13:01 yysirs

我也卡在这了,你解决了吗

550952213 avatar Mar 03 '22 07:03 550952213

解决了。法1:降级pytorch==1.4.0 法2:extended_attention_mask = extended_attention_mask.to(dtype=next(self.parameters()).dtype) # fp16 compatibility 改成extended_attention_mask = extended_attention_mask.to(dtype=torch.float32) # fp16 compatibility 就是报错的最后一个。 服务器的话,要在服务器上找到那个环境下改,我就是在本地改的,一直没映射上去

550952213 avatar Mar 03 '22 07:03 550952213