dinov2
dinov2 copied to clipboard
problem with installing mmcv
conda env create -f conda-extras.yaml
fails with error message
Solving environment: done
==> WARNING: A newer version of conda exists. <==
current version: 23.7.4
latest version: 23.9.0
Please update conda by running
$ conda update -n base -c conda-forge conda
Or to minimize the number of packages updated during conda update use
conda install conda=23.9.0
Downloading and Extracting Packages
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
Installing pip dependencies: \ Ran pip subprocess with arguments:
['/opt/conda/envs/dinov2-extras/bin/python', '-m', 'pip', 'install', '-U', '-r', '/home/jovyan/code/dinov2/condaenv.786udvr2.requirements.txt', '--exists-action=b']
Pip subprocess output:
Looking in indexes: https://pypi.org/simple, https://pypi.nvidia.com
Collecting git+https://github.com/facebookincubator/submitit (from -r /home/jovyan/code/dinov2/condaenv.786udvr2.requirements.txt (line 1))
Cloning https://github.com/facebookincubator/submitit to /tmp/pip-req-build-4xumvgau
Resolved https://github.com/facebookincubator/submitit to commit e8600a2b9e9cbe05751ab433bbaba2ae960d8ac2
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Preparing metadata (pyproject.toml): started
Preparing metadata (pyproject.toml): finished with status 'done'
Collecting cuml-cu11 (from -r /home/jovyan/code/dinov2/condaenv.786udvr2.requirements.txt (line 3))
Using cached https://pypi.nvidia.com/cuml-cu11/cuml_cu11-23.8.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1081.8 MB)
Collecting mmcv-full==1.5.0 (from -r /home/jovyan/code/dinov2/condaenv.786udvr2.requirements.txt (line 4))
Using cached mmcv-full-1.5.0.tar.gz (530 kB)
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'error'
Pip subprocess error:
Running command git clone --filter=blob:none --quiet https://github.com/facebookincubator/submitit /tmp/pip-req-build-4xumvgau
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [16 lines of output]
/tmp/pip-install-pa3tzeja/mmcv-full_26c44a3cfd544d1f80c1a675007fd507/setup.py:6: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
from pkg_resources import DistributionNotFound, get_distribution
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/tmp/pip-install-pa3tzeja/mmcv-full_26c44a3cfd544d1f80c1a675007fd507/setup.py", line 422, in <module>
ext_modules=get_extensions(),
File "/tmp/pip-install-pa3tzeja/mmcv-full_26c44a3cfd544d1f80c1a675007fd507/setup.py", line 326, in get_extensions
ext_ops = extension(
File "/opt/conda/envs/dinov2-extras/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 1048, in CUDAExtension
library_dirs += library_paths(cuda=True)
File "/opt/conda/envs/dinov2-extras/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 1179, in library_paths
if (not os.path.exists(_join_cuda_home(lib_dir)) and
File "/opt/conda/envs/dinov2-extras/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 2223, in _join_cuda_home
raise EnvironmentError('CUDA_HOME environment variable is not set. '
OSError: CUDA_HOME environment variable is not set. Please set it to your CUDA install root.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
failed
CondaEnvException: Pip failed
I am installing on AWS Sagemaker studio, with a base conda env as attached. cuda is installed via conda.
And if I try installing using pip I get the following error
Same here. Have you found a workaround @nagitam ?
@BrianPulfer No. I ended up updating the dinov2 code base to work with the latest version of mmcv, mmseg and mmengine (for the inference part only).
Hi @nagitam I am working on updating mmcv to latest version. Could you share your code?
pip install mmcv==1.7.1
@Sycamorers
pip install mmcv==1.7.1
This will end up the error like this `Output exceeds the size limit. Open the full output data in a text editor--------------------------------------------------------------------------- ModuleNotFoundError Traceback (most recent call last) Cell In[3], line 1 ----> 1 from mmseg.apis import init_segmentor, inference_segmentor
File ~/anaconda3/envs/dinov2-extras/lib/python3.9/site-packages/mmseg/apis/init.py:2 1 # Copyright (c) OpenMMLab. All rights reserved. ----> 2 from .inference import inference_segmentor, init_segmentor, show_result_pyplot 3 from .test import multi_gpu_test, single_gpu_test 4 from .train import (get_root_logger, init_random_seed, set_random_seed, 5 train_segmentor)
File ~/anaconda3/envs/dinov2-extras/lib/python3.9/site-packages/mmseg/apis/inference.py:9 6 from mmcv.runner import load_checkpoint 8 from mmseg.datasets.pipelines import Compose ----> 9 from mmseg.models import build_segmentor 12 def init_segmentor(config, checkpoint=None, device='cuda:0'): 13 """Initialize a segmentor from config file. 14 15 Args: (...) 23 nn.Module: The constructed segmentor. 24 """
File ~/anaconda3/envs/dinov2-extras/lib/python3.9/site-packages/mmseg/models/init.py:2 ... 125 break 126 level += 1 --> 127 return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: No module named 'mmcv._ext'` How did you solve it?