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

文章来自:https://www.cnblogs.com/sbj123456789/p/9693948.html
© 2021 jiaocheng.bubufx.com  联系我们
ICP备案:鲁ICP备09046678号-3