Aradhye2002 / EcoDepth

[CVPR'2024] Official implementation of the paper "ECoDepth: Effective Conditioning of Diffusion Models for Monocular Depth Estimation"
https://ecodepth-iitd.github.io/
MIT License
167 stars 17 forks source link

ecodepth module not found #6

Closed jtsanborn1 closed 7 months ago

jtsanborn1 commented 7 months ago

When running test.py or infer.py or any py I get this error:

Traceback (most recent call last): File "D:\AITools\EcoDepth\depth\test.py", line 9, in from models.model import EcoDepth File "D:\AITools\EcoDepth\depth\models\model.py", line 11, in from ecodepth.models import UNetWrapper, EmbeddingAdapter ModuleNotFoundError: No module named 'ecodepth'

Any way to fix this?

Windows 10, rtx 3090, python 3.10.11

Aradhye2002 commented 7 months ago

It seems your PYTHONPATH is not configured properly. By any chance, have you removed the PYTHONPATH="$(dirname $0)/..":"$(dirname $0)/../stable-diffusion":$PYTHONPATH line from the shell files?

We tried locally with this change and got the same result as yours.

Additionally please ensure you are running from the EcoDepth/depth directory though I think that is not the problem here.

jtsanborn1 commented 7 months ago

No, i haven't touched any shell file, just ran them as they came trough. Should I modify the PYTHONPATH line in the shell file? or what you mean when you say my pythonpath is not configured properly.

I have my env variables path set :

PATH : C:\Users\PC\AppData\Local\Programs\Python\Python310\Scripts\ PATH: C:\Users\PC\AppData\Local\Programs\Python\Python310\ PYTHONPATH: C:\Users\PC\AppData\Local\Programs\Python\Python310\

surajiitd commented 7 months ago

Are you running the test.py file from bash scripts given by us? Please follow these steps. ecodepth and stable-diffusion/* directories which are present in the repo-root should be visible to python, so we have modified the PYTHONPATH in the all bash files. Alternative method is to first export the PYTHONPATH by using the below command in your terminal(run this after navigating inside depth directory where test.py is present): export PYTHONPATH="..:../stable-diffusion":$PYTHONPATH If you are using windows, you can't run bash files directly. So better install WSL and then you will have a bash terminal there.

jtsanborn1 commented 7 months ago

Thanks guys! I finally managed to get it working. I just had to set PYTHONPATH root folder of this repo. Just tested with a single image and worked, now testing with video but it really takes a while even with a rtx 3090 24gb. I think you guys should put memory requirements for the estimation process.

For anyone facing the "No module named 'ecodepth" error, you can run this command on your terminal before running infer.py " set PYTHONPATH=C:/Users/xxx/Ecodepth " or wherever your repo folder is located and it should work now.

Aradhye2002 commented 7 months ago

Glad to know. Feel free to open another issue if you face a problem.

By the way, for reducing GPU memory and increasing inference speed, you can reduce the max_area variable in the predict function inside infer.py.