ptrblck:

this post


Hi, the problem comes from the computation of gradients and backpropagation:
loss_d.backward(retain_graph=True)
optimizer_d.step()
loss_ge.backward(retain_graph=True)
optimizer_ge.step()
When I remove these two lines:
loss_ge.backward(retain_graph=True)
optimizer_ge.step()
the code works but sure it is incorrect. So I understand That the problem come from here. Do you have any suggestions please?
Thank you,