It shows no errors but what I get is simply a red square. If the model was wrong, I would expect at least an incorrect gradcam but I’m not sure. Also, I just modified the class to receive a custom model (basically ResNet18) and the same last 4th layer is chosen.

  

      Medium – 31 Jul 21
  

  
    

GradCAM in PyTorch 2

  Implementing GradCAM in PyTorch

  
    Reading time: 3 min read
  

  

  
    
    
  

  


Thank you!