Grad-cam working for PyTorch with custom model

I have been trying to use grad-cam for a custom model I made in pytorch but can’t figure out how to do it. The model I made is a classifier model using ResNet50. Any help on how I can use gradcam to create a heatmap on images with based on my model would be really appreaciated.

Thank you!

Captum provides a Guided GradCam implementation here, which might be useful. :wink:

Thanks! I’ll have a look