Skip to content

Commit

Permalink
Update the installation of MMCV (#45)
Browse files Browse the repository at this point in the history
* [Docs] update batch size

* Update the installation of MMCV
  • Loading branch information
linyq17 committed Feb 18, 2022
1 parent 839115f commit 38afc01
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 26 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,19 +87,19 @@ jobs:
]
include:
- torch: 1.5.1+cu101
torch_version: torch1.5.1
torch_version: torch1.5
torchvision: 0.6.1+cu101
mmcv: 1.5.0
- torch: 1.6.0+cu101
torch_version: torch1.6.0
torch_version: torch1.6
torchvision: 0.7.0+cu101
mmcv: 1.6.0
- torch: 1.7.0+cu101
torch_version: torch1.7.0
torch_version: torch1.7
torchvision: 0.8.1+cu101
mmcv: 1.7.0
- torch: 1.8.0+cu101
torch_version: torch1.8.0
torch_version: torch1.8
torchvision: 0.9.0+cu101
mmcv: 1.8.0

Expand Down Expand Up @@ -164,7 +164,7 @@ jobs:
torch: [1.9.0+cu102]
include:
- torch: 1.9.0+cu102
torch_version: torch1.9.0
torch_version: torch1.9
torchvision: 0.10.0+cu102
mmcv: 1.9.0

Expand Down
10 changes: 6 additions & 4 deletions docs/en/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,15 @@ Or you can still install MMFewShot manually:
1. Install mmcv-full.

```shell
pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/{cu_version}/{torch_version}/index.html
# pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/{cu_version}/{torch_version}/index.html
pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu102/torch1.10.0/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 11.0` and `PyTorch 1.7.0`, use the following command:
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.

```shell
pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu110/torch1.7.0/index.html
```
# We can ignore the micro version of PyTorch
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 Down
23 changes: 6 additions & 17 deletions docs/zh_cn/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,29 +60,18 @@ MIM 能够自动地安装 OpenMMLab 的项目以及对应的依赖包。
1. 安装 mmcv-full,我们建议使用预构建包来安装:

```shell
pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/{cu_version}/{torch_version}/index.html
# pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/{cu_version}/{torch_version}/index.html
pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu102/torch1.10.0/index.html
```

需要把命令行中的 `{cu_version}``{torch_version}` 替换成对应的版本。例如:在 CUDA 11 和 PyTorch 1.7.0 的环境下,可以使用下面命令安装最新版本的 MMCV:
PyTorch 在 1.x.0 和 1.x.1 之间通常是兼容的,故 mmcv-full 只提供 1.x.0 的编译包。如果你的 PyTorch 版本是 1.x.1,你可以放心地安装在 1.x.0 版本编译的 mmcv-full。

```shell
pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu110/torch1.7.0/index.html
```

请参考 [MMCV](https://mmcv.readthedocs.io/en/latest/#installation) 获取不同版本的 MMCV 所兼容的的不同的 PyTorch 和 CUDA 版本。同时,也可以通过以下命令行从源码编译 MMCV:

```shell
git clone https://github.com/open-mmlab/mmcv.git
cd mmcv
MMCV_WITH_OPS=1 pip install -e . # 安装好 mmcv-full
cd ..
# 我们可以忽略 PyTorch 的小版本号
pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu102/torch1.10/index.html
```

或者,可以直接使用命令行安装:

```shell
pip install mmcv-full
```
请参阅 [MMCV](https://github.com/open-mmlab/mmcv#install-with-pip) 了解不同版本的 MMCV 与不同版本的 PyTorch 和 CUDA 的兼容情况。同时,您可以使用以下命令从源码编译 MMCV:

2. 安装 MMClassification 和 MMDetection.

Expand Down

0 comments on commit 38afc01

Please sign in to comment.