captum icon indicating copy to clipboard operation
captum copied to clipboard

Import Issue

Open HCWDavid opened this issue 3 years ago • 3 comments

Hi,

for some reason, I can not import

captum.attr.visualization based on the utilities link

both visualize_timeseries_attr and visualize_image_attr would not work. I am wondering if I did something wrong? if not, could it be fixed on the document to know how to do it?

And I tried captum.attr._utils.visualization this, and it works only on visualize_image_attr but not visualize_timeseries_attr

Thank you!

HCWDavid avatar Oct 04 '22 15:10 HCWDavid

@HCWDavid, have you tried to import it like this ?

from captum.attr import visualization as viz

similar to this tutorial: https://captum.ai/tutorials/Resnet_TorchVision_Interpret

What is the import error that you see ?

NarineK avatar Oct 05 '22 19:10 NarineK

This is the error I am getting when I try to use timeseries: AttributeError: module 'captum.attr._utils.visualization' has no attribute 'visualize_timeseries_attr'

HCWDavid avatar Oct 07 '22 13:10 HCWDavid

Hi @HCWDavid , the issue with visualize_timeseries_attr is likely due to the method being recently added, so it was not included in the previous pip / conda releases, and will be available in the next release.

To utilize this functionality in the meantime, you would need to install Captum from source. To do this, you can follow the Manual / Dev Install instructions here. Hope this helps!

vivekmig avatar Oct 07 '22 13:10 vivekmig

Closing this issue, feel free to open another one if there are further issues.

vivekmig avatar Oct 18 '22 15:10 vivekmig