Pytorch中的错误和bug

RuntimeError:one of the variables needed for gradient computation has been modified by an inplace operation

原因:0.4.0把Varible和Tensor融合为一个Tensor,inplace操作,之前对Varible能用,但现在对Tensor,就会出错了,所以找到模型中所有的inplace操作,换成非inplace的写法就行

参考:https://blog.csdn.net/DuinoDu/article/details/80435127

猜你喜欢

转载自www.cnblogs.com/sbj123456789/p/9693948.html
今日推荐