I’ve tried cloning and running this along with all the other tricks I could find online with no luck:
#git clone https://github.com/pytorch/captum.git
#pip install -e .
git clone https://github.com/UserName/captum
git checkout custom-branch
pip install -e .
If I use the above code, I can import captum but can’t import any submodules.
Are you able to build captum from master and import submodules?
If so, I guess your custom branch might be broken.
I just tested installing the latest release of Captum and it seems to have worked:
!git clone https://github.com/pytorch/captum
!git checkout "v0.2.0"
!pip3 install -e .
Testing the imports:
from captum.attr import (
from captum import custom_module # This fails
The master branch seems to install correctly as well, but my custom branch still does not. I haven’t changed anything on my custom branch relating to the submodule organization or setup.py, so I don’t understand why I can’t import the one submodule?
Edit: The import in the custom module’s
__init__.py were changed from relative to absolute, and that looks like it might be the cause.