idiap / fullgrad-saliency

Full-gradient saliency maps
Other
203 stars 32 forks source link

Can FullGrad be applied to ResNet? #13

Open yikekk opened 3 years ago

yikekk commented 3 years ago

Sorry to bother you, I wonder whether FullGrad can be applied to ResNet? I've tried Simple FullGrad on ResNet-50 and it succeeded. But when I try FullGrad on ResNet-50, an error about dimensionality appeared.

suraj-srinivas commented 3 years ago

Hi, the example code provided (dump_images.py) indeed works on resnet models. What is your input dimensionality?

yikekk commented 3 years ago

My input dimensionality is [1,3,224,224]. Actually, when I use normal resnet-50, it works. But when I use ResNet-50 from https://github.com/szq0214/MEAL-V2, an error occurs.

RuntimeError: The expanded size of the tensor (256) must match the existing size (64) at non-singleton dimension 1. Target sizes: [1, 256, 56, 56]. Tensor sizes: [1, 64, 1, 1]

suraj-srinivas commented 3 years ago

Does this error occurs only on fullgrad and not on simple fullgrad?

yikekk commented 3 years ago

Yes, this error occurs on fullgrad and smooth_fullgrad