JDAI-CV / LIO

Look-into-Object: Self-supervised Structure Modeling for Object Recognition (CVPR 2020)
Other
113 stars 24 forks source link

RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation #9

Closed ZDstandup closed 3 years ago

ZDstandup commented 4 years ago

I run the code and raise an error: RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.cuda.FloatTensor [10, 49]], which is output 0 of SubBackward0, is at version 1; expected version 0 instead. Hint: enable anomaly detection to find the operation that failed to compute its gradient, with torch.autograd.set_detect_anomaly(True).

How to solve it? Change the inplace=True into inplace=False?

ZDstandup commented 4 years ago

Now I have solved this problem.