lpiccinelli-eth / UniDepth

Universal Monocular Metric Depth Estimation
Other
473 stars 39 forks source link

encountered an error while executing the demo #1

Open feolcn opened 3 months ago

feolcn commented 3 months ago

python ./scripts/demo.py

Torch version: 2.2.0+cu121

Downloading: "https://github.com/lpiccinelli-eth/unidepth/zipball/main" to /home/feol/.cache/torch/hub/main.zip

Instantiate: dinov2_vitl14

UniDepthV1_ViTL14 is loaded with:

missing keys: ['pixel_encoder.register_tokens']

additional keys: []

Segmentation fault (core dumped)

lpiccinelli-eth commented 3 months ago

We never encountered Seg Fault in our tests, I believe it could related to cuda version mismatch between torch and xformers, do you have the same (ie 11.8) in both?

As an additional check, could you please try running UniDepth with ConvNext backbone, namely change line 39 to "UniDepth_ConvNextL" .

anticdimi commented 3 months ago

Hi there @lpiccinelli-eth ,

I encounter the same issue as @feolcn. With ConvNextL backbone, this is the missing key pixel_encoder.mask_token.

I can confirm both xformers and torch are with cuda 11.8.

lpiccinelli-eth commented 3 months ago

The missing keys are just warnings you can totally ignore.

mask_token and register_tokens are just dummy nn.Parameter to comply with different backbones.

anticdimi commented 3 months ago

@lpiccinelli-eth: Any insights on segfault error? :smile: I built conda environment from scratch using the provided instructions.

lpiccinelli-eth commented 3 months ago

I have a few questions to understand your setting:

feolcn commented 3 months ago

I have a few questions to understand your setting:

  • Which GPU are you using? one Rtx 3090 ubuntu 22.04
  • Are you running locally or remotely? both locally and remotely
  • Is it going OOM? (RAM since the model is first loaded on CPU) No OOM issue has occurred Thank you for your relpy
lpiccinelli-eth commented 3 months ago

We tested on the same hardware, RTX 3090 with Ubuntu 22.04 and we had no seg fault.

Is it possible that you have conflicts in your environment (CUDA or torch / xformers mismatch)? Did you create a new one and follow the instructions in the README?

maliksyria commented 3 months ago

I have followed instructions regarding Conda and having same Segmentation fault (core dumped) error.

lpiccinelli-eth commented 3 months ago

Can you please share your env and the system information (OS, python, cuda...)?

maliksyria commented 3 months ago

Now it works. Worked only when I downloaded both pytorch 2.2.0and xformers using conda commands not pip and commenting things related to torch and nvidia inside requirements.txt. By the way, thanks for your work.

lpiccinelli-eth commented 3 months ago

When it was not working, did you install anything with conda, or only with pip? I suppose some inconsistencies of the conda env could have been a problem.

maliksyria commented 3 months ago

when it was not working, all dependencies and libraries were downloaded using pip command just as README. However, this was inside conda environment.

Davidyao99 commented 3 months ago

I am facing the same issue with using conda. I tried to use python venv but am facing this problem ModuleNotFoundError: No module named 'unidepth'. I see unidepth being installed via pip so I am unsure of why this is happening. Any help is appreciated!

lpiccinelli-eth commented 3 months ago

We corrected the requirements.txt as @maliksyria suggested and we tested the installation copy-pasting what is written in the README with both conda (and installing unidepth via pip) and with python venv on 3 different cards (A6000, RTX3090, and RTX4090) and 2 different clusters and we never encountered Seg Fault or any other problems.

It would be of great help to the community if you could post your env, system (OS and GPU), and the specific commands you used when you face any errors, thanks!

feolcn commented 3 months ago

We corrected the requirements.txt as @maliksyria suggested and we tested the installation copy-pasting what is written in the README with both conda (and installing unidepth via pip) and with python venv on 3 different cards (A6000, RTX3090, and RTX4090) and 2 different clusters and we never encountered Seg Fault or any other problems.

It would be of great help to the community if you could post your env, system (OS and GPU), and the specific commands you used when you face any errors, thanks!

Thank you for your work and response. I re-downloaded your project and set up a new environment using conda , following each step in the readme file. However, I encountered the same error. My setup is CUDA 11.8, Ubuntu 22.04, and NVIDIA 3090. Following maliksyria's suggestion, I used pip uninstall torch and then conda install torch, which made it work properly. I'm not sure of the reason, but I am very grateful.

carzy-z commented 2 weeks ago

I am also facing the same situation as @Davidyao99 . Have you solved it now? Can you help me