pytorch / captum

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

Missing Jupyter-captum-insights/extension while running Captum insights example. #638

Open Arvind-Ideas2IT opened 3 years ago

Arvind-Ideas2IT commented 3 years ago

Hi, when I ran Captum Insights example python -m captum.insights.example and even tried out the CIFAR_TorchVision_Captum_Insights.ipynb in jupyter notebook. I am able to render the visualizer and it says "Captum Insights widget created" and "Fetch data and view Captum Insights at http://localhost:49826/". But this URL shows the error "jinja2.exceptions.TemplateNotFound"

image

I ran the mentioned updated commands to enable Jupyter Widget before running the examples 1) jupyter nbextension install --py --symlink --sys-prefix captum.insights.attr_vis.widget 2) jupyter nbextension enable captum.insights.attr_vis.widget --py --sys-prefix

running the above commands give me "Jupyter-captum-insights/extension missing, I believe this is the reason for the above errors?

image

I am using 1) Windows 10 with conda env 2) widgetsnbextension 3.5.1 3) ipywidgets 7.6.3 4) Captum 0.3.1

Possibly other useful information:

image

Please let me know if more information needed. Please advise what I am missing?

bilalsal commented 3 years ago

Hi @Arvind-Ideas2IT ,

it seems that Captum Insights (as a React.js app) was not built properly?

Running BUILD_INSIGHTS=true python setup.py install as proposed in https://github.com/pytorch/captum/issues/628#issuecomment-797081799 should help.

Let me know if you need more help on this

Arvind-Ideas2IT commented 3 years ago

Hi @Arvind-Ideas2IT ,

it seems that Captum Insights (as a React.js app) was not built properly?

Running BUILD_INSIGHTS=true python setup.py install as proposed in #628 (comment) should help.

Let me know if you need more help on this

Hi @bilalsal thanks for the quick response, Yeeha it worked in the ubuntu machine and I was able to run the examples and see the results. But this is still not working in windows conda env. The issue I faced in windows conda env was BUILD_INSIGHTS=true is not valid internal or external command when I ran the BUILD_INSIGHTS=true python setup.py install

To resolve this I tried two things 1.) I made BUILD_INSIGHTS=true in def check_env_flag() by default and ran python setup.py install, but it did not work and it was not able to generate static/extension files 2.) I copied static\extension files from my ubuntu machine which successfully build Captum insights and build it again in windows but it is still not working.

But overall it working in ubuntu

NarineK commented 3 years ago

@Arvind-Ideas2IT, @bilalsal is this still an open problem that needs to be addressed ?