isl-org / MiDaS

Code for robust monocular depth estimation described in "Ranftl et. al., Towards Robust Monocular Depth Estimation: Mixing Datasets for Zero-shot Cross-dataset Transfer, TPAMI 2022"
MIT License
4.27k stars 599 forks source link

Setup error, no cuda #204

Closed s0updev closed 1 year ago

s0updev commented 1 year ago

Hi, how do I install all dependencies? Im on Windows 11, rtx 3080 laptop When I enter conda env create -f environment.yaml in anaconda terminal, I get an error:

  Collecting package metadata (repodata.json): done
  Solving environment: failed

  ResolvePackageNotFound:
    - nvidia::cudatoolkit=11.7
deng232 commented 1 year ago

you need to add conda-forge to the channel

s0updev commented 1 year ago

Ive tried, same error:

(base) C:\3D\Stable Diffusion\MiDaS>conda config --add channels conda-forge

(base) C:\3D\Stable Diffusion\MiDaS>conda env create -f environment.yaml
Collecting package metadata (repodata.json): done
Solving environment: failed

ResolvePackageNotFound:
  - nvidia::cudatoolkit=11.7
deng232 commented 1 year ago

create an new conda environment and run this command conda install pytorch==1.13.1 torchvision==0.14.1 torchaudio==0.13.1 pytorch-cuda=11.7 -c pytorch -nvidia then install rest of the packages

deng232 commented 1 year ago

https://pytorch.org/get-started/previous-versions/

s0updev commented 1 year ago
(midas-env) C:\3D\Stable Diffusion\MiDaS>conda install pytorch==1.13.1 torchvision==0.14.1 torchaudio==0.13.1 pytorch-cuda=11.7 -c pytorch -nvidia

EnvironmentLocationNotFound: Not a conda environment: C:\Users\admin\miniconda3\envs\vidia

Another error smh

deng232 commented 1 year ago

conda install pytorch torchvision torchaudio pytorch-cuda=11.7 -c pytorch -c nvidia

s0updev commented 1 year ago

its installing packages finally:

(base) C:\3D\Stable Diffusion\MiDaS>conda env create -f env_2.yaml
Collecting package metadata (repodata.json): done
Solving environment: done

Downloading and Extracting Packages
libcusolver-dev-11.4 | 95.7 MB   | ############################################################################ | 100%
certifi-2022.12.7    | 149 KB    | ############################################################################ | 100%
win_inet_pton-1.1.0  | 9 KB      | ############################################################################ | 100%
libcufft-11.0.2.4    | 6 KB      | ############################################################################ | 100%
idna-3.4             | 97 KB     | ############################################################################ | 100%
libcublas-12.1.0.26  | 39 KB     | ############################################################################ | 100%
libcusolver-11.4.4.5 | 30 KB     | ############################################################################ | 100%
cuda-nvprof-12.1.55  | 1.6 MB    | ############################################################################ | 100%
wincertstore-0.2     | 15 KB     | ############################################################################ | 100%
pyopenssl-23.0.0     | 98 KB     | ############################################################################ | 100%
mkl_fft-1.3.1        | 136 KB    | ############################################################################ | 100%
torchvision-0.14.1   | 7.5 MB    | ############################################################################ | 100%
cuda-nsight-compute- | 1 KB      | ############################################################################ | 100%
numpy-1.23.4         | 11 KB     | ############################################################################ | 100%
cuda-demo-suite-12.1 | 4.7 MB    | ############################################################################ | 100%
libnpp-12.0.2.50     | 305 KB    | ############################################################################ | 100%
brotlipy-0.7.0       | 335 KB    | ############################################################################ | 100%
pip-22.3.1           | 2.8 MB    | ############################################################################ | 100%
cffi-1.15.1          | 239 KB    | ############################################################################ | 100%
python-3.10.8        | 15.8 MB   | ############################################################################ | 100%
cuda-sanitizer-api-1 | 12.9 MB   | ############################################################################ | 100%
cuda-nvdisasm-12.1.5 | 48.0 MB   | ############################################################################ | 100%
libcurand-10.3.2.56  | 3 KB      | ############################################################################ | 100%
libcufft-dev-11.0.2. | 102.6 MB  | ############################################################################ | 100%
libcusparse-dev-12.0 | 162.5 MB  | ############################################################################ | 100%
pytorch-1.13.1       | 1.10 GB   | ###########################################################################9 | 100%
urllib3-1.26.14      | 195 KB    | ############################################################################ | 100%
libcublas-dev-12.1.0 | 348.3 MB  | ############################################################################ | 100%
 ... (more hidden) ...

waiting...

s0updev commented 1 year ago
Downloading and Extracting Packages
openssl-1.1.1t       | 5.0 MB    | ############################################################################ | 100%
certifi-2022.12.7    | 147 KB    | ############################################################################ | 100%
markupsafe-2.1.2     | 25 KB     | ############################################################################ | 100%
jinja2-3.1.2         | 99 KB     | ############################################################################ | 100%
mpmath-1.3.0         | 428 KB    | ############################################################################ | 100%
networkx-3.0         | 1.4 MB    | ############################################################################ | 100%
torchvision-0.15.0   | 7.7 MB    | ############################################################################ | 100%
sympy-1.11.1         | 11.9 MB   | ############################################################################ | 100%
python_abi-3.10      | 4 KB      | ############################################################################ | 100%
filelock-3.10.0      | 14 KB     | ############################################################################ | 100%
torchaudio-2.0.0     | 5.7 MB    | ############################################################################ | 100%
pytorch-2.0.0        | 1.17 GB   | ##################################                                           |  45%
ca-certificates-2022 | 143 KB    | ############################################################################ | 100%  

Do I really need another pytorch which is another 1.2gb? 😦

s0updev commented 1 year ago

It's working now, thx

deng232 commented 1 year ago

I didn't see there are two pytorch just by running the command I paste, may be it was the pytorch listed in the env_2.yaml

s0updev commented 1 year ago

yes, there was one, it's env_2 contains what you've messaged earlier

name: midas-py310
channels:
  - pytorch
  - nvidia
  - defaults
dependencies:
  - pytorch=1.13.1
  - cudatoolkit=11.7
  - python=3.10.8
  - torchvision=0.14.1
  - pip=22.3.1
  - numpy=1.23.4
  - pip:
    - opencv-python==4.6.0.66
    - imutils==0.5.4
    - timm==0.6.12
    - einops==0.6.0
deng232 commented 1 year ago

you only need one of them. pytorch 2.0 I'm not sure it will work or not and I deleted that message because I found there are package conflict need to resolve, so it's better just install manually

deng232 commented 1 year ago

and I didn't test pytorch 2.0 so its better to keep 1.13.1

s0updev commented 1 year ago

I see, pytorch 2.0 was installed with this command: conda install pytorch torchvision torchaudio pytorch-cuda=11.7 -c pytorch -c nvidia, how do I uninstall just 2.0 now?

deng232 commented 1 year ago

you may run "conda list" first to see which version is saved

s0updev commented 1 year ago
pytorch                   2.0.0           py3.10_cuda11.7_cudnn8_0    pytorch
pytorch-cuda              11.7                 h67b0de4_0    pytorch
pytorch-mutex             1.0                        cuda    pytorch
s0updev commented 1 year ago

depth generation is working tho, so if there's just one version its fine I guess

deng232 commented 1 year ago

remove package https://stackoverflow.com/questions/38459186/conda-uninstall-one-package-and-one-package-only

only install pytorch

>conda install pytorch=1.13.1 -c pytorch 

install pytorch and others

conda install pytorch=1.13.1 torchvision torchaudio pytorch-cuda=11.7 -c pytorch -c nvidia