Transferred 348/349 items
0%| | 0/504 [00:00<?, ?it/s]
Traceback (most recent call last):
File "yolov5_heatmap.py", line 117, in
model(r'E:\test\envyolo5\yolov5C3\datasets\00194.jpg', 'result')
File "yolov5_heatmap.py", line 81, in call
score.backward(retain_graph=True)
File "E:\test\envyolo5\lib\site-packages\torch\tensor.py", line 245, in backward
torch.autograd.backward(self, gradient, retain_graph, create_graph, inputs=inputs)
File "E:\test\envyolo5\lib\site-packages\torch\autograd__init__.py", line 147, in backward
allow_unreachable=True, accumulate_grad=True) # allow_unreachable flag
RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.cuda.FloatTensor [1, 3, 20, 20, 7]], which is output 0 of SigmoidBackward, 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).
Transferred 348/349 items 0%| | 0/504 [00:00<?, ?it/s] Traceback (most recent call last): File "yolov5_heatmap.py", line 117, in
model(r'E:\test\envyolo5\yolov5C3\datasets\00194.jpg', 'result')
File "yolov5_heatmap.py", line 81, in call
score.backward(retain_graph=True)
File "E:\test\envyolo5\lib\site-packages\torch\tensor.py", line 245, in backward
torch.autograd.backward(self, gradient, retain_graph, create_graph, inputs=inputs)
File "E:\test\envyolo5\lib\site-packages\torch\autograd__init__.py", line 147, in backward
allow_unreachable=True, accumulate_grad=True) # allow_unreachable flag
RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.cuda.FloatTensor [1, 3, 20, 20, 7]], which is output 0 of SigmoidBackward, 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).
请问UP这个怎么破,谢谢