Open lovettchris opened 10 months ago
same error, used to work well but fails since today.
also same error here: FWIW Ubuntu 22.04 with CUDA 12.2 and 535.129.03 NVidia Driver... replacing "cuml-cu11" with "cuml-cu12" did not work
You may try to install an older version like this: $ pip install --no-cache-dir --extra-index-url https://pypi.nvidia.com cuml-cu11==23.10.0
that works, thanks.
interesting, for me pip install --no-cache-dir --extra-index-url https://pypi.nvidia.com/ cuml-cu11==23.10.0
didn't work either (same error ; tried older versions too)
Seems to be fixed by now... usual pip install -r requirements.txt worked fine.
Interesting, Florian, can you post the version of CUDA, pytorch and Python that you are using?
Sure, in my virtual environment (venv, not conda) is Python 3.10.12, PyTorch 2.0.0+cu117 and NVIDIA 535.129.03 with CUDA 12.2
issues seems fixed for me. fyi I'm using the conda installation.
@Florian2Richter interestingly conda.yaml and conda-extras.yaml contains python 3.9.
In order to get the dinov2 segmentation head working on Ubuntu I had to build mmcv from source using MMCV_WITH_OPS=1 pip install -e .
which required a newer version of GCC that support C++17, and then I could get the segmentation head working on CUDA, and measured about 4 seconds per inference on a Tesla T4 GPU using small backbone dinov2_vits14
. I also had to install ftfy and regex pip packages. For me the "pip install mmcv-full==1.5.0" results in the error:
ModuleNotFoundError: No module named 'mmcv._ext'
I can confirm that installing mmcv
from the source fixed the issue when running segmentation scripts. You need to clone the specific version (not just main
branch) via the following command git clone https://github.com/open-mmlab/mmcv.git --branch v1.5.3 --single-branch
and install nvcc v11.7
if needed before building mmcv
(conda install -c conda-forge cudatoolkit-dev=11.7
). For the regular pip install
I get the same error as @lovettchris.
@lovettchris, have you tried to reproduce segmentation results? I am a little bit lost about patch size: all dinov2 backbones have patch size equal to 14, however in the segmentation evaluation it is assumed to be 16 (>It is used to produce a low-resolution logit map (eg 32x32 for a model with patch size 16)
and the input image size is 512, which is divisible by 16 but not 14). After modifying the config for patch size equal to 14, I can partly reproduce results for ADE20k
, but not for Pascal VOC
.
EDIT (22.02.24): I've managed to reproduce results both for ADE20k
and Pascal VOC
. Don't forget to override init_weights()
method for your backbone. It is not enough to load checkpoint weights during the constructor call. Otherwise, during segmentation training weights can be overridden by default weights initialization (source).
Your backbone (dinov2/eval/segmentation/models/backbones/vision_transformer.py
) should look similar to this.
Feel free to ping me if you have some issues.
I had several issues setting up the environment for segmentation properly.
I did the following:
cuml-cu11==23.10.0
as explained by @kuma94506 pip3 install -r requirements.txt
. I didn't install therequirements-extra.txt
: instead, I followe the next steps.git clone https://github.com/open-mmlab/mmcv.git --branch v1.5.0 --single-branch
cd mmcv/
MMCV_WITH_OPS=1 pip install -e .
pip3 install mmsegmentation==0.27.0
pip3 install opencv-python
I still get error: ModuleNotFoundError: No module named 'mmcv.ops'
. @lovettchris @bruce-willis how did you fix this? Thanks
failes with this error
$ pip install --no-cache-dir --extra-index-url https://pypi.nvidia.com cuml-cu11
And the recommended fix
pip install --no-cache-dir --extra-index-url https://pypi.nvidia.com cuml-cu11
fails with the same error.