pytorch-grad-cam icon indicating copy to clipboard operation
pytorch-grad-cam copied to clipboard

A weird thing about the gradient for each channel.

Open hxngu opened this issue 8 months ago • 5 comments
trafficstars

I have printed out the gradient of feature map of one layer. However, I find a weird thing that the elements in each channel hold the same in all locations. I have written some codes to print out the gradient matrix of the layer4 of ResNet50. Basically speaking, the gradients of one channel in different locations should be different.

Image

The result is shown below. I have tried some different inputs but it still doesn't work.

Image

Looking forward to your reply.

hxngu avatar Mar 06 '25 14:03 hxngu