AgeProgression
AgeProgression copied to clipboard
RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation
Has anyone ever encountered with this error? I'd appreciate it so much if you have any solutions. RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.cuda.FloatTensor [1024, 100]], which is output 0 of TBackward, is at version 2; expected version 1 instead. Hint: the backtrace further above shows the operation that failed to compute its gradient. The variable in question was changed in there or anywhere later. Good luck!
me too
fix it by modifying the following code:
d_z_prior = self.Dz(z_prior.detach()) d_z = selfDz(z.detach())
.
The solution came from here:https://github.com/pytorch/pytorch/issues/39141
The solution did not help, is there anything else I could try