使用一個pytorch寫的模型時,報錯:RuntimeError:one of the variables needed for gradient computation has been modified by an inplace operation
解決方法一:如果使用的是pytorch0.4.0版本,回退到pytorch0.3.0版本
解決方法二:如果有inreplace參數,設為False
解決方法三:報錯原因是pytorch0.4.0版本后tensor不支持inplace操作了,所以把所有inplace錯作去掉。