Open noobgrow opened 2 years ago
Hi, you can refer to the closed issue #1
@withtimesgo1115 sir, THANKS for your reply! I refer to the issue #1 ,then download the WZMIAOMIAO's code of yolo, and add the gradCAM code in it. The error above occurs again.
I solve this error as follows: I found SliceBackward occur in NMS code, so I tried to define intermediate variables to avoid variable value re-assignment. Then I can get the leaf Tensor(Input image)'s gradient.
您好,能看一下您修改后的代码吗?十分感谢! @noobgrow
在backward()计算时报错, one of the variables needed for gradient computation has been modified by an inplace operation: [torch.FloatTensor [3, 1]], which is output 0 of SliceBackward, is at version 2; 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). 认为应该是nms过程中求导的问题,您能否提供使用的代码学习一下?万分感谢!!!