OpenMMLab Computer Vision Foundation
Documentation | ️Installation | Reporting Issues
The OpenMMLab team released a new generation of training engine MMEngine at the World Artificial Intelligence Conference on September 1, 2022. It is a foundational library for training deep learning models. Compared with MMCV, it provides a universal and powerful runner, an open architecture with a more unified interface, and a more customizable training process.
MMCV v2.0.0 official version was released on April 6, 2023. In version 2.x, it removed components related to the training process and added a data transformation module. Also, starting from 2.x, it renamed the package names mmcv to mmcv-lite and mmcv-full to mmcv. For details, see Compatibility Documentation.
MMCV will maintain both 1.x (corresponding to the original master branch) and 2.x (corresponding to the main branch, now the default branch) versions simultaneously. For details, see Branch Maintenance Plan.
MMCV is a foundational library for computer vision research and it provides the following functionalities:
It supports the following systems:
See the documentation for more features and usage.
Note: MMCV requires Python 3.7+.
There are two versions of MMCV:
Note: Do not install both versions in the same environment, otherwise you may encounter errors like ModuleNotFound. You need to uninstall one before installing the other. Installing the full version is highly recommended if CUDA is available.
Before installing mmcv, make sure that PyTorch has been successfully installed following the PyTorch official installation guide. For apple silicon users, please use PyTorch 1.13+.
The command to install mmcv:
pip install -U openmim
mim install mmcvIf you need to specify the version of mmcv, you can use the following command:
mim install mmcv==2.0.0If you find that the above installation command does not use a pre-built package ending with .whl but a source package ending with .tar.gz, you may not have a pre-build package corresponding to the PyTorch or CUDA or mmcv version, in which case you can build mmcv from source.
Looking in links: https://download.openmmlab.com/mmcv/dist/cu102/torch1.8.0/index.html
Collecting mmcv
Downloading https://download.openmmlab.com/mmcv/dist/cu102/torch1.8.0/mmcv-2.0.0-cp38-cp38-manylinux1_x86_64.whl
Looking in links: https://download.openmmlab.com/mmcv/dist/cu102/torch1.8.0/index.html
Collecting mmcv==2.0.0
Downloading mmcv-2.0.0.tar.gz
For more installation methods, please refer to the Installation documentation.
If you need to use PyTorch-related modules, make sure PyTorch has been successfully installed in your environment by referring to the PyTorch official installation guide.
pip install -U openmim
mim install mmcv-liteIf you face some installation issues, CUDA related issues or RuntimeErrors, you may first refer to this Frequently Asked Questions.
If you face installation problems or runtime issues, you may first refer to this Frequently Asked Questions to see if there is a solution. If the problem is still not solved, feel free to open an issue.
If you find this project useful in your research, please consider cite:
@misc{mmcv,
title={{MMCV: OpenMMLab} Computer Vision Foundation},
author={MMCV Contributors},
howpublished = {\\url{https://github.com/open-mmlab/mmcv}},
year={2018}
}We appreciate all contributions to improve MMCV. Please refer to CONTRIBUTING.md for the contributing guideline.
MMCV is released under the Apache 2.0 license, while some specific operations in this library are with other licenses. Please refer to LICENSES.md for the careful check, if you are using our code for commercial matters.
MMCV currently has four branches, namely main, 1.x, master, and 2.x, where 2.x is an alias for the main branch, and master is an alias for the 1.x branch. The 2.x and master branches will be deleted in the future. MMCV's branches go through the following three stages:
| Phase | Time | Branch | description |
|---|---|---|---|
| RC Period | 2022.9.1 - 2023.4.5 | Release candidate code (2.x version) will be released on 2.x branch. Default master branch is still 1.x version | Master and 2.x branches iterate normally |
| Compatibility Period | 2023.4.6 - 2023.12.31 | The 2.x branch has been renamed to the main branch and set as the default branch, and 1.x branch will correspond to 1.x version | We still maintain the old version 1.x, respond to user needs, but try not to introduce changes that break compatibility; main branch iterates normally |
| Maintenance Period | From 2024/1/1 | Default main branch corresponds to 2.x version and 1.x branch is 1.x version | 1.x branch is in maintenance phase, no more new feature support; main branch is iterating normally |
[Bug] Build fails because the latest PyTorch release requires c++20
[Bug]ModuleNotFoundError: No module named 'mmcv._ext'(Buid from source on Linux with CUDA12.8, python 3.12, pytorch2.9.1+cu128 )
[Docs] Request for official installation guide for MMCV on AMD ROCm and Intel Arc oneAPI platforms
[Bug] setup.py raises `ModuleNotFoundError: No module named 'pkg_resources'` after release of setuptools 82.0
[Docs] How I Built MMCV 2.1.0 on Windows 11 for RTX 5060 Ti (CUDA 12.8)
[Bug] AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'?
[Docs] Build from source with Python 3.12 + PyTorch 2.8 + CUDA 12.9 is easy and works on Linux
[Docs] How I Got MMCV to Build on RTX 5090 (CUDA 12.8)
[Bug] win10 cuda12.8 pytorch2.11 error when installing mmcv2.1.0
[Bug] 昇腾910B芯片上在Jupyterlab容器中使用mmcv的sigmoid_focal_loss接口时出现python GIL问题