hiyoung123 / SoftMaskedBert

Soft-Masked Bert 复现论文:https://arxiv.org/pdf/2005.07421.pdf
255 stars 47 forks source link

总是报RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.FloatTensor [768]] 错误? #2

Closed NLPAN closed 4 years ago

NLPAN commented 4 years ago

使用torch==1.5.0,transformers==2.11.0 ,总是报RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.FloatTensor [768]] is at version 3; expected version 2 instead.错误,想问作者使用的什么版本,是否遇到过类似错误,谢谢了。

NLPAN commented 4 years ago

网上说是使用+=等操作造成的,可是已将代码中存在相关操作进行替换了。

qq596588073 commented 4 years ago

您好,我也遇到这个问题了,请问您解决了么

ldy8665 commented 4 years ago

你好,请问你怎么解决的呢?