How to implement Grad-CAM on my model instead of VGG?


I’ve found a lot of different examples of implementing Grad-CAM on VGG or other pre-trained models in torchvision, and I want to integrate it with my own trained model in order to visualize the feature importance. But the example code all used features and classifier method in VGG, which my model does not have. Is there any way to do it without having these two methods? Because I don’t want to retrained the model again.



Hi, I made this simple example based on this post.