You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.cuda.FloatTensor [256, 1]], which is output 0 of AsStridedBackward0, 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).
after tried using torch.autograd.set_detect_anomaly(True) , the error report is as follows:
RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.cuda.FloatTensor [256, 1]], which is output 0 of AsStridedBackward0, 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!
does there anyone have met this problem? thank you!
The text was updated successfully, but these errors were encountered:
I met the error as follow:
at line
pi_loss.backward(retain_graph = True)
:after tried using
torch.autograd.set_detect_anomaly(True)
, the error report is as follows:does there anyone have met this problem? thank you!
The text was updated successfully, but these errors were encountered: