參考: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