Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"ModuleNotFoundError: No module named 'idisc'" when running test.py #7

Open
AvidahRai opened this issue Jul 30, 2023 · 3 comments
Open

Comments

@AvidahRai
Copy link

Hi thank you for your wonderful work and the zoo. I was performing benchmark evals on SOTA MDE models for my dissertation.

I tried to replicate your work in Google Colab (instead of conda) and when I run !python ./scripts/test.py --model-file ./idisc_nyu_resnet101.pt --config-file ./configs/nyu/nyu_r101.json --base-path ../temp/datasets I get an error.

Traceback (most recent call last):
  File "/content/idisc/./scripts/test.py", line 14, in <module>
    import idisc.dataloders as custom_dataset
ModuleNotFoundError: No module named 'idisc'

I dont know why this is happening. My suspicion is !bash ./make.sh is this because it threw low of exceptions but said "Finished processing dependencies for MultiScaleDeformableAttention==1.0
".

Your help is greatly appreciated.

@lpiccinelli-eth
Copy link
Collaborator

Thank you for using our model, I believe that the main problem is that idisc is not in the pythonpath.
You should do something like export PYTHONPATH="<IDISC-REPO_PATH>:${PYTHONPATH}" before running the model (where <IDISC-REPO_PATH> is the to idisc dir like $HOME/Workspace/idisc).

@AvidahRai
Copy link
Author

Thank you. export command did not work on Goggle Colab. However, I did this.

import os
os.environ['PYTHONPATH'] = f"{os.getcwd()}:{os.environ.get('PYTHONPATH', '')}"

Also, I had to manually change /idisc/idisc/models/ops/make.sh file on line 5

python setup.py build install --prefix $VIRTUAL_ENV
to
pip install -e .

Then I could finally run !bash ./make.sh

After doing that I was able to run the test.py code. I got the same results as stated without disparity.
E.g.
image

Thank you very much.

@BiaBibii
Copy link

BiaBibii commented Nov 5, 2023

Hi, could you please share the Google Colab notebook you use?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants