I am working on classification of five different types of images of skin and I trained the AlexNet model and GoogleNet Model. Now I wanted to implement the Grad-CAM on the final layer of the these models and want to get the heat-map.
after reading many blogs and coding material I reach here 4. This code is specifically use resnet50 model.
model = models.resnet50(pretrained=True)
grad_cam = GradCam(model=model, feature_module=model.layer4, \
                   target_layer_names=["2"], use_cuda=args.use_cuda)

How should I pass the feature_module and target_layer_names to constructor of the grad_cam class for AlexNet and for GoogleNet.
I realized I need to get the final layer from the Pretrain Network by using the following code.
 new_classifier = nn.Sequential(*list(model.classifier.children())[:-1])
 model.classifier = new_classifier  

How can I use this way to pass as parameter to the grad_cam class.