hiyoung123/SoftMaskedBert

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

NLPAN opened this issue · 3 comments

NLPAN commented

使用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

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

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

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