idisc icon indicating copy to clipboard operation
idisc copied to clipboard

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

Open AvidahRai opened this issue 2 years ago • 3 comments

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.

AvidahRai avatar Jul 30 '23 12:07 AvidahRai

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).

lpiccinelli-eth avatar Jul 31 '23 12:07 lpiccinelli-eth

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.

AvidahRai avatar Aug 04 '23 01:08 AvidahRai

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

BiaBibii avatar Nov 05 '23 13:11 BiaBibii