Open Oasis1307 opened 4 years ago
Can you try tensor = tensor.detach()?
If using this tensor to compute weights, the first noise type iteration is ok. But the second noise type it cannot compute grads = torch.autograd.grad()
RuntimeError: Trying to backward through the graph a second time, but the buffers have already been freed. Specify retain_graph=True when calling backward the first time.
which pytorch version do you use, please?
Try consistent_loss.backward(retain_graph=True)
have you solved the problem yet? I tried everything.
eg: hidden[0].detach() hidden[1].detach() => hidden.detach_()
That's all right
RuntimeError: Can't detach views in-place. Use detach() instead
I have no idea why it can't detach views in-place. Any way to get around this problem? thanks!pytorch 1.3.1