参考:RuntimeError: one of the variables needed for gradient computation has been modified by an inplace o
报错
RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation
解决办法
检查自己的pytorch相关的代码,把所有类似x += 1
的操作,全部换成x = x + 1