utkuozbulak / pytorch-cnn-visualizations

Pytorch implementation of convolutional neural network visualization techniques
MIT License
7.81k stars 1.49k forks source link

Score-CAM: 'ResNet' object has no attribute 'features' #90

Closed chuanenlin closed 3 years ago

chuanenlin commented 3 years ago

In scorecam.py, the code gets the model features using model.features (line 28).

This works for architectures like AlexNet and VGG, but doesn't work for WideResNet or ResNet with the error message: 'ResNet' object has no attribute 'features'

Any idea how to run Score-CAM for a pre-trained WideResNet model?

utkuozbulak commented 3 years ago

Hey,

You can see relevant discussion for models that don't contain convolutions in a 'features' sequential module here: https://github.com/utkuozbulak/pytorch-cnn-visualizations/issues/82