pytorch / captum

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

Import error for Occlusion #292

Closed chauhang closed 4 years ago

chauhang commented 4 years ago

Getting import error for Occlusion on running the tutorial Interpreting vision for Resnet.

Error details ImportError Traceback (most recent call last)

in 15 from captum.attr import IntegratedGradients 16 from captum.attr import GradientShap ---> 17 from captum.attr import Occlusion 18 from captum.attr import NoiseTunnel 19 from captum.attr import visualization as viz ImportError: cannot import name 'Occlusion' from 'captum.attr' (/home/ubuntu/opt/anaconda3/envs/pytorch/lib/python3.7/site-packages/captum/attr/__init__.py)
NarineK commented 4 years ago

Hi @chauhang !

Thank you for the issue. We haven't released the new version yet. Occlusion is one of the recent algorithms that we have added. The release will happen by the end of Feb, that's why we recommend to install the dev version.

The instructions are under: Manual / Dev install https://github.com/pytorch/captum

Let me know if that works for you!

NarineK commented 4 years ago

@chauhang , did the dev version work for you ? If so, can we close the issue ?

NarineK commented 4 years ago

closing this since we released new version and it should work as expected.