Compatible MMCV, MMClassification and MMDetection versions are shown as below. Please install the correct version of them to avoid installation issues.
| MMFewShot version | MMCV version | MMClassification version | MMDetection version |
mmcv-full is only compiled on PyTorch 1.x.0 because the compatibility usually holds between 1.x.0 and 1.x.1. If your PyTorch version is 1.x.1, you can install mmcv-full compiled with PyTorch 1.x.0 and it usually works well.
Optionally you can compile mmcv from source if you need to develop both mmcv and mmfewshot. Refer to the [guide](https://github.com/open-mmlab/mmcv#installation) for details.
pip install -v -e . # or "python setup.py develop"
**Note:**
a. When specifying `-e` or `develop`, MMFewShot is installed on dev mode
, any local modifications made to the code will take effect without reinstallation.
b. If you would like to use `opencv-python-headless` instead of `opencv-python`,
you can install it before installing MMCV.
c. Some dependencies are optional. Simply running `pip install -v -e .` will
only install the minimum runtime requirements. To use optional dependencies like `albumentations` and `imagecorruptions` either install them manually with `pip install -r requirements/optional.txt` or specify desired extras when calling `pip` (e.g. `pip install -v -e .[optional]`). Valid keys for the extras field are: `all`, `tests`, `build`, and `optional`.
### Another option: Docker Image
We provide a [Dockerfile](https://github.com/open-mmlab/mmfewshot/blob/master/docker/Dockerfile) to build an image. Ensure that you are using [docker version](https://docs.docker.com/engine/install/) >=19.03.
```shell
# build an image with PyTorch 1.6, CUDA 10.1
docker build -t mmfewshot docker/
```
Run it with
```shell
docker run --gpus all --shm-size=8g -it -v {DATA_DIR}:/mmfewshot/data mmfewshot
```
## Verification
To verify whether MMFewShot is installed correctly, we can run the demo code and inference a demo image.