Closed vishals2911 closed 3 years ago
which version did you use?
try add this line in singan/trainning.py line229
errG = -output.mean()
errG.detach_().requires_grad_(True) #add this line
errG.backward(retain_graph=True)
if alpha!=0:
RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.FloatTensor [3, 32, 3, 3]] 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).