Skip to content

Commit

Permalink
[Enhancement] Update the installation of MMCV (#89)
Browse files Browse the repository at this point in the history
* [Enhancement] Update the installation of MMCV

* revise unmatch torchvision

* del 1.8 pytorch check

* fix torch1.9-cpu check bug

* fix torch1.9-cpu check bug
  • Loading branch information
MeowZheng authored Feb 9, 2022
1 parent 0a9a724 commit 62cc403
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 24 deletions.
44 changes: 22 additions & 22 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,23 @@ jobs:
strategy:
matrix:
python-version: [3.7]
torch: [1.6.0, 1.7.0, 1.8.0, 1.9.0]
torch: [1.5.1, 1.7.1, 1.9.0]
include:
- torch: 1.6.0
torchvision: 0.7.0
- torch: 1.7.0
torchvision: 0.8.1
- torch: 1.8.0
torchvision: 0.9.0
- torch: 1.5.1
torch_version: torch1.5
torchvision: 0.6.1
- torch: 1.7.1
torch_version: torch1.7
torchvision: 0.8.2
- torch: 1.9.0
torch_version: torch1.9
torchvision: 0.10.0
- torch: 1.8.0
torchvision: 0.9.0
python-version: 3.9
- torch: 1.9.0
torch_version: torch1.9
torchvision: 0.10.0
python-version: 3.8
- torch: 1.9.0
torch_version: torch1.9
torchvision: 0.10.0
python-version: 3.9
steps:
Expand All @@ -51,7 +51,7 @@ jobs:
run: pip install torch==${{matrix.torch}}+cpu torchvision==${{matrix.torchvision}}+cpu -f https://download.pytorch.org/whl/torch_stable.html
- name: Install MMCV
run: |
pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cpu/torch${{matrix.torch}}/index.html
pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cpu/${{matrix.torch_version}}/index.html
python -c 'import mmcv; print(mmcv.__version__)'
- name: Install unittest dependencies
run: pip install -r requirements/tests.txt -r requirements/optional.txt
Expand All @@ -75,24 +75,24 @@ jobs:
torch: [1.6.0+cu101, 1.7.0+cu101, 1.8.0+cu101]
include:
- torch: 1.6.0+cu101
torch_version: 1.6.0
torch_version: torch1.6
torchvision: 0.7.0+cu101
- torch: 1.7.0+cu101
torch_version: 1.7.0
torch_version: torch1.7
torchvision: 0.8.1+cu101
- torch: 1.8.0+cu101
torch_version: 1.8.0
torch_version: torch1.8
torchvision: 0.9.0+cu101
- torch: 1.8.0+cu101
torch_version: 1.8.0
torch_version: torch1.8
torchvision: 0.9.0+cu101
python-version: 3.6
- torch: 1.8.0+cu101
torch_version: 1.8.0
torch_version: torch1.8
torchvision: 0.9.0+cu101
python-version: 3.8
- torch: 1.8.0+cu101
torch_version: 1.8.0
torch_version: torch1.8
torchvision: 0.9.0+cu101
python-version: 3.9
steps:
Expand All @@ -110,7 +110,7 @@ jobs:
run: python -m pip install torch==${{matrix.torch}} torchvision==${{matrix.torchvision}} -f https://download.pytorch.org/whl/torch_stable.html
- name: Install MMCV
run: |
python -m pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu101/torch${{matrix.torch_version}}/index.html
python -m pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu101/${{matrix.torch_version}}/index.html
python -c 'import mmcv; print(mmcv.__version__)'
- name: Install unittest dependencies
run: python -m pip install -r requirements/tests.txt -r requirements/optional.txt
Expand All @@ -135,14 +135,14 @@ jobs:
torch: [1.9.0+cu102]
include:
- torch: 1.9.0+cu102
torch_version: 1.9.0
torch_version: torch1.9
torchvision: 0.10.0+cu102
- torch: 1.9.0+cu102
torch_version: 1.9.0
torch_version: torch1.9
torchvision: 0.10.0+cu102
python-version: 3.8
- torch: 1.9.0+cu102
torch_version: 1.9.0
torch_version: torch1.9
torchvision: 0.10.0+cu102
python-version: 3.9
steps:
Expand All @@ -160,7 +160,7 @@ jobs:
run: python -m pip install torch==${{matrix.torch}} torchvision==${{matrix.torchvision}} -f https://download.pytorch.org/whl/torch_stable.html
- name: Install MMCV
run: |
python -m pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu102/torch${{matrix.torch_version}}/index.html
python -m pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu102/${{matrix.torch_version}}/index.html
python -c 'import mmcv; print(mmcv.__version__)'
- name: Install unittest dependencies
run: python -m pip install -r requirements/tests.txt -r requirements/optional.txt
Expand Down
8 changes: 6 additions & 2 deletions docs/en/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,13 @@ c. Install MMCV, we recommend you to install the pre-built mmcv as below.
pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/{cu_version}/{torch_version}/index.html
```

Please replace ``{cu_version}`` and ``{torch_version}`` in the url to your desired one. For example, to install the latest ``mmcv-full`` with ``CUDA 10.2`` and ``PyTorch 1.10.0``, use the following command:
Please replace ``{cu_version}`` and ``{torch_version}`` in the url to your desired one. 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.
For example, to install the latest ``mmcv-full`` with ``CUDA 10.2`` and ``PyTorch 1.10.0``, use the following command:

```shell
pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu102/torch1.10.0/index.html
pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu102/torch1.10/index.html
```

See [here](https://github.com/open-mmlab/mmcv#installation) for different versions of MMCV compatible to different PyTorch and CUDA versions.
Expand All @@ -76,6 +79,7 @@ cd ..
```

**Important:** You need to run `pip uninstall mmcv` first if you have mmcv installed. If `mmcv` and `mmcv-full` are both installed, there will be `ModuleNotFoundError`.

## Install MMFlow

a. Clone the MMFlow repository.
Expand Down

0 comments on commit 62cc403

Please sign in to comment.