Notice you have in the Path:/home/npuser/.clearml/venvs-builds/3.7/task_repository/commons-imagery-models-py/sfi
But you should have:/home/npuser/.clearml/venvs-builds/3.7/task_repository/commons-imagery-models-py/
PYTHONPATH: /home/npuser/.clearml/venvs-builds/3.7/task_repository/commons-imagery-models-py/sfi:/home/npuser/.clearml/venvs-builds/3.7/task_repository/commons-imagery-models-py:/home/npuser/.clearml/venvs-builds/3.7/task_repository/commons-imagery-models-py/sfi/imagery/models/training::/home/npuser/.clearml/venvs-builds/3.7/task_repository/commons-imagery-models-py/sfi:/usr/lib64/python37.zip:/usr/lib64/python3.7:/usr/lib64/python3.7/lib-dynload:/home/npuser/.clearml/venvs-builds/3.7/lib64/python3.7/site-packages:/home/npuser/.clearml/venvs-builds/3.7/lib/python3.7/site-packages
PYTHONPATH is still not working as expected
inside your code if you do :import os print("PYTHONPATH", os.environ["PYTHONPATH"])
what are you getting?
Would be great if the docker_bash_setup_script
had output I could see
/home/npuser/.clearml/venvs-builds/3.7/task_repository/commons-imagery-models-py
Yep I see it now, could you simulate locally (i.e have the other folders in the path as well)?
could it be you also have a file somewhere that is called sfi or imagery or models or chip_classifier that it accidently tries to import first from ?
BoredHedgehog47 were you able to locate the issue ?
The config change worked but my PYTHONPATH is still not working as expected
Could it be something else is missing and hence the import fails ?
BoredHedgehog47
is this ( https://clearml.slack.com/archives/CTK20V944/p1665426268897429?thread_ts=1665422655.799449&cid=CTK20V944 ) the same issue (or solution) ?
Seems like it has everything I would need
note
/home/npuser/.clearml/venvs-builds/3.7/task_repository/commons-imagery-models-py
is the correct pat
So how come it is failing?
Can you also print sys.path
just to be sure ?
When I run from sfi.imagery import models. It works fine local. So the repo is setup for proper imports. But fails in clearML tasks
This is to address the PYTHONPATH issues
Yea I've done that already but I can do it again
yea IDK, the git repo is a python library. Is it possible to run something like pip install -e .
so I can utilize the setup.py?
Traceback (most recent call last): File "sfi/imagery/models/training/ldc_train_end_to_end.py", line 26, in <module> from sfi.imagery.models.chip_classifier.eval import eval_chip_classifier ModuleNotFoundError: No module named 'sfi.imagery.models'
For instance, In my repo, I have a setup.py, how would I run pip install -e .
AgitatedDove14 How would I install using a setup.py in a clearML task?
If you look lower, it is there '/home/npuser/.clearml/venvs-builds/3.7/task_repository/commons-imagery-models-py'
Seems related to this https://github.com/allegroai/clearml/issues/241
I was hoping to use docker_bash_setup_script
but it didn't work when I ran pip install -e .
in the respective script
SysPath: ['/home/npuser/.clearml/venvs-builds/3.7/task_repository/commons-imagery-models-py/sfi/imagery/models/training', '/home/npuser/.clearml/venvs-builds/3.7/task_repository/commons-imagery-models-py/sfi', '/home/npuser/.clearml/venvs-builds/3.7/task_repository/commons-imagery-models-py', '/usr/lib64/python37.zip', '/usr/lib64/python3.7', '/usr/lib64/python3.7/lib-dynload', '/home/npuser/.clearml/venvs-builds/3.7/lib64/python3.7/site-packages', '/home/npuser/.clearml/venvs-builds/3.7/lib/python3.7/site-packages']
note /home/npuser/.clearml/venvs-builds/3.7/task_repository/commons-imagery-models-py
is the correct path
When I run this line locally, it works finefrom sfi.imagery.models.chip_classifier.eval import eval_chip_classifier
Not yet AgitatedDove14 Perhaps we can pair on this Monday.
basically, can I do local installs vs supplying a requirements.txt