pytorch / captum

Model interpretability and understanding for PyTorch
https://captum.ai
BSD 3-Clause "New" or "Revised" License
4.91k stars 494 forks source link

Can I use captum to interpret the networks not in torchvision, such as efficientnet? #346

Closed yangfantrinity closed 4 years ago

yangfantrinity commented 4 years ago

I have managed to run the example using resnet-18.

But when I tried to load my own trained efficientnet, it doesn't give me any error nor result. Am I missing any essential step when apply it on non torchvision models?

Updates: I managed to run it. but keep getting the "out of memory" error. Still trying to fix it.

Updates 2: I can get the Guided GradCAM run by specifying the particular layer we want to calculate. For efficientnet, I need to guided_gradcam = GuidedGradCam(model, model._conv_head) attributions_ggc = guided_gradcam.attribute(image_input, target=pred_label_idx)

NarineK commented 4 years ago

@yangfantrinity, Update2 sounds right! Is this still an open issue ?

yangfantrinity commented 4 years ago

@yangfantrinity, Update2 sounds right! Is this still an open issue ?

No. Not anymore. I will close this issue.

Thank you @NarineK for your confirmation.