pooya-mohammadi / yolov5-gradcam

Visualizing Yolov5's layers using GradCam
MIT License
281 stars 47 forks source link

why register_backward_hook() got the zero gradient #6

Closed infochen closed 2 years ago

infochen commented 2 years ago

I took the gradcam for yolov3 and revise a little. I have no idea about why register_backward_hook() couldn't get the gradient. The register_forward_hook() is ok. can you help me, thanks a lot. image

infochen commented 2 years ago

I used yolov3.pt for the yolov5-gradcam. The result like this:

image

I didn't change anything this time. I am confused about this situation

infochen commented 2 years ago

I figured out! I choose wrong layer before and the choosed layer' size must small.

xiaobaidediyitian commented 2 years ago

Hello, I have the same problem, may I ask how to solve it