Skip to content

Required python packages

Won-Kyu Park edited this page Feb 16, 2024 · 4 revisions

All required packages are automatically installed. However, in some cases, the correct package version may not be installed, causing problems when running.

  • mmcv == 2.1.0 (install using mim install mmcv)
  • mmengine == 0.8.5
  • mmyolo == 0.6.0 (install using pip install mmyolo)

  • mmyolo 0.6.0 may not work with mmcv == 2.1.1 but you can fix this issue by patching manually. fix version restriction at venv/Lib/site-packages/mmyolo/__init__.py (fix mmcv_maximum_version = '2.1.0' to mmcv_maximum_version = '2.1.1' works just fine.

  • mmengine 0.9.1 will not work under windows. but you can use mmengine 0.9.1 + patched bitsnbytes at https://github.com/wkpark/bitsandbytes/actions/runs/6887358987 (login github and scroll down you will find a downloadable artifacts)

How to update/install

  1. open cmd prompt or use terminal shell.
  2. change to the sdwebui dir and enable venv. (on Windows for example, cd stable-diffusion-webui and venv\scripts\activate)
  3. install mmcv==2.1.0 or mmcv=2.0.0 using mim (to use mmcv==2.1.0 you have to patch mmyolo/__init__.py manually.)
    • mim install mmcv==2.1.0,

use mmdet with torch 2.2.0+cu121

in this case, mim install mmcv or mim install mmdet will try to compile it from source but failed.

  1. you need to prepare CUDA 12.1.x on your system.
  2. pip install mmdet
  3. pip install mmcv==2.1.0 -f https://download.openmmlab.com/mmcv/dist/cu121/torch2.1/index.html
  4. pip install mmyolo

how to install mmdet using mim

in this case, mim install mmdet will automatically try to compile mmcv from source tarball. we need MSVC compiler.

  1. check torch version and your CUDA version: for example, if you use torch-2.2.0+cu121, you have to match CUDA 12.1.x on your system.
  2. install visual studio 2022
  3. open x64 native command prompt
  4. mim install mmcv will automatically compile mmcv for you.

Notes

Even if you can't use mmdet models due to issues like mmcv version issue, you can still use mediapipe_* models or ultralytics yolov8 models.

Clone this wiki locally