utkuozbulak / pytorch-cnn-visualizations

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

AttributeError: 'NoneType' object has no attribute 'data' #6

Closed ZHuiLBo closed 6 years ago

ZHuiLBo commented 6 years ago

I ran "python gradcam.py" command in the './src/' directory , and i got the AttributeError: 'NoneType' object has no attribute 'data', how to solve this problem?

1

utkuozbulak commented 6 years ago

Hey, I changed the model from VGG to Alexnet a while ago and the target layer in gradcam was left as 35. Since Alexnet doesn't have that many layers it produces the error. Changed the target layer to 11. It should work as now.

ZHuiLBo commented 6 years ago

It worked!Thank u very much

utkuozbulak commented 6 years ago

Great!