由于使用自动conda install Dinov2的环境总是报错,安装失败,所以尝试手动安装所有的依赖库,细节如下。

步骤

  1. conda创建新的环境:
    conda activate dinov2
  2. 安装pytorch:
    pip install torch==2.0.0+cu117 torchvision==0.15.1+cu117 -f https://download.pytorch.org/whl/torch_stable.html -i https://pypi.tuna.tsinghua.edu.cn/simple
    
  3. 安装其他依赖包:
    pip install omegaconf
    pip install fvcore
    pip install iopath
    pip install torchmetrics==0.10.3
    pip install xformers==0.0.18
    pip install submitit
    pip install --extra-index-url=https://pypi.nvidia.com cudf-cu11
    pip install "/home/wangzhenrong/Downloads/mmcv_full-1.5.0-cp39-cp39-manylinux1_x86_64.whl"
    pip install mmsegmentation==0.27.0

在pycharm中配置这个虚拟环境:


源代码依赖的环境参考:

name: dinov2-extras
channels:
  - defaults
  - pytorch
  - nvidia
  - xformers
  - conda-forge
dependencies:
  - python=3.9
  - pytorch::pytorch=2.0.0
  - pytorch::pytorch-cuda=11.7.0
  - pytorch::torchvision=0.15.0
  - omegaconf
  - torchmetrics=0.10.3
  - fvcore
  - iopath
  - xformers::xformers=0.0.18
  - pip
  - pip:
    - git+https://github.com/facebookincubator/submitit
    - --extra-index-url https://pypi.nvidia.com
    - cuml-cu11
    - mmcv-full==1.5.0
    - mmsegmentation==0.27.0

Logo

欢迎加入 MCP 技术社区!与志同道合者携手前行,一同解锁 MCP 技术的无限可能!

更多推荐