RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.cuda.FloatTensor [8, 256,19, 19]], which is output 0 of LeakyReluBackward1, is at version 2; expected version 1 instead. Hint: enable anomaly detection to find the operation that failed to compute its gradient, with torch.autograd.set_detect_anomaly(True).解决办法
将block内所有relu的inplace = True 改为false即可
主要是记录一下自己平时遇到的问题,和大家分享一下
如有侵犯,请联系我
点个赞支持一下吧