LBAM_Pytorch icon indicating copy to clipboard operation
LBAM_Pytorch copied to clipboard

About code error

Open haolin512900 opened this issue 4 years ago • 4 comments

Hi Thank your great project! The code works up to PyTorch 1.4.There seems to be an problem with PyTorch 1.6. the description as followed:RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation:[torch.cuda.FloatTensor [1, 1024, 4, 4]] 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). Can you update the code for PyTorch 1.5 or 1.6?😂

haolin512900 avatar Dec 25 '20 08:12 haolin512900

I meet this problem too...

543877815 avatar May 31 '21 11:05 543877815

@haolin512900 Have you solved this error??

543877815 avatar May 31 '21 11:05 543877815

replace "G_loss.backward()" whith "loss1 = G_loss.detach_().requires_grad_(True)
loss1.backward()"

wsfwsf avatar Mar 21 '22 14:03 wsfwsf

thank you

------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2022年3月21日(星期一) 晚上10:50 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [Vious/LBAM_Pytorch] About code error (#9)

replace "G_loss.backward()" whith "loss1 = G_loss.detach_().requires_grad_(True) loss1.backward()"

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

haolin512900 avatar Mar 23 '22 05:03 haolin512900