Skip to content

Commit

Permalink
refine
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouzaida committed Jul 24, 2022
1 parent 11d4741 commit 865261d
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 33 deletions.
26 changes: 14 additions & 12 deletions README_zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,19 @@ MMCV 支持多种平台,包括:

MMCV 有两个版本:

- **mmcv-full**: 完整版,包含所有的特性以及丰富的开箱即用的 CUDA 算子。
- **mmcv**: 精简版,不包含 CUDA 算子但包含其余所有特性和功能,类似 MMCV 1.0 之前的版本。如果你不需要使用 CUDA 算子的话,精简版可以作为一个考虑选项。
- **mmcv-full**: 完整版,包含所有的特性以及丰富的开箱即用的 CPU 和 CUDA 算子。
- **mmcv**: 精简版,不包含 CPU 和 CUDA 算子但包含其余所有特性和功能,类似 MMCV 1.0 之前的版本。如果你不需要使用算子的话,精简版可以作为一个考虑选项。

**注意**: 请不要在同一个环境中安装两个版本,否则可能会遇到类似 `ModuleNotFound` 的错误。在安装一个版本之前,需要先卸载另一个。`如果CUDA可用,强烈推荐安装mmcv-full`

### 安装 mmcv-full

在安装 mmcv-full 之前,请确保 PyTorch 已经成功安装在环境中,可以参考 [PyTorch 官方安装文档](https://github.com/pytorch/pytorch#installation)

在 Linux 和 Windows 平台安装 mmcv-full 的命令如下
在 Linux 和 Windows 平台安装 mmcv-full 的命令如下(如果你的系统是 macOS,请参考[源码安装 mmcv-full](https://mmcv.readthedocs.io/zh_CN/latest/get_started/build.html#macos-mmcv-full)

```bash
pip install openmim
pip install -U openmim
mim install mmcv-full
```

Expand All @@ -75,19 +77,19 @@ mim install mmcv-full
mim install mmcv-full==1.5.0
```

如果发现上述的安装命令没有使用 mmcv-full 预编译包安装,则表示没有提供对应 PyTorch 或者 CUDA 或者 mmcv-full 版本的预编译包,此时,请参考[源码安装 mmcv-full](https://mmcv.readthedocs.io/zh_CN/latest/get_started/build.html#mmcv-full)
如果发现上述的安装过程没有使用 mmcv-full 预编译包安装,则可能是没有对应 PyTorch 或者 CUDA 或者 mmcv-full 版本的预编译包,那么,你可能需要[源码安装 mmcv-full](https://mmcv.readthedocs.io/zh_CN/latest/get_started/build.html#mmcv-full)

如果想要在 macOS 平台安装 mmcv-full,请参考[源码安装 mmcv-full](https://mmcv.readthedocs.io/zh_CN/latest/get_started/build.html#macos-mmcv-full)
更多安装方式请参考[安装文档](https://mmcv.readthedocs.io/zh_CN/latest/get_started/installation.html)

### 安装 mmcv

如果你需要使用和 PyTorch 相关的模块,请确保 PyTorch 已经成功安装在环境中,可以参考 [PyTorch 官方安装文档](https://github.com/pytorch/pytorch#installation)

```bash
pip install openmim
pip install -U openmim
mim install mmcv
```

如果想从源码编译 MMCV,请参考[源码安装 mmcv](https://mmcv.readthedocs.io/zh_CN/latest/get_started/build.html#mmcv)

## 支持的部分开源项目

- [MIM](https://github.com/open-mmlab/mim): MIM 是 OpenMMlab 项目、算法、模型的统一入口
Expand All @@ -111,19 +113,19 @@ mim install mmcv

## FAQ

如果你遇到了安装问题,CUDA 相关的问题或者 RuntimeErrors,可以首先参考[问题解决页面](https://mmcv.readthedocs.io/zh_CN/latest/faq.html)查看是否已经有解决方案
如果你遇到了安装问题,CUDA 相关的问题或者 RuntimeError,可以先参考[问题解决页面](https://mmcv.readthedocs.io/zh_CN/latest/faq.html)查看是否已有解决方案。如果问题仍然没有解决,欢迎提 [issue](https://github.com/open-mmlab/mmcv/issues)

## 贡献指南

我们感谢所有的贡献者为改进和提升 MMCV 所作出的努力。请参考[贡献指南](CONTRIBUTING.md)来了解参与项目贡献的相关指引。

## 许可证

`MMCV` 目前以 Apache 2.0 的许可证发布,但是其中有一部分功能并不是使用的 Apache2.0 许可证,我们在 [许可证](LICENSES.md) 中详细地列出了这些功能以及他们对应的许可证,如果您正在从事盈利性活动,请谨慎参考此文档。
`MMCV` 目前以 Apache 2.0 的许可证发布,但是其中有一部分功能并不是使用的 Apache2.0 许可证,我们在[许可证](LICENSES.md)中详细地列出了这些功能以及他们对应的许可证,如果您正在从事盈利性活动,请谨慎参考此文档。

## 欢迎加入 OpenMMLab 社区

扫描下方的二维码可关注 OpenMMLab 团队的 [知乎官方账号](https://www.zhihu.com/people/openmmlab),加入 OpenMMLab 团队的 [官方交流 QQ 群](https://jq.qq.com/?_wv=1027&k=3ijNTqfg),或添加微信小助手”OpenMMLabwx“加入官方交流微信群。
扫描下方的二维码可关注 OpenMMLab 团队的[知乎官方账号](https://www.zhihu.com/people/openmmlab),加入 OpenMMLab 团队的[官方交流 QQ 群](https://jq.qq.com/?_wv=1027&k=3ijNTqfg),或添加微信小助手”OpenMMLabwx“加入官方交流微信群。

<div align="center">
<img src="docs/en/_static/zhihu_qrcode.jpg" height="400" /> <img src="docs/en/_static/qq_group_qrcode.jpg" height="400" /> <img src="docs/en/_static/wechat_qrcode.jpg" height="400" />
Expand Down
21 changes: 13 additions & 8 deletions docs/zh_cn/get_started/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,24 @@
python -c 'import torch;print(torch.__version__)'
```

```{note}
1. 如需编译 ONNX Runtime 自定义算子,请参考[如何编译ONNX Runtime自定义算子?](https://mmcv.readthedocs.io/zh_CN/latest/deployment/onnxruntime_op.html#id1)
2. 如需编译 TensorRT 自定义,请参考[如何编译MMCV中的TensorRT插件](https://mmcv.readthedocs.io/zh_CN/latest/deployment/tensorrt_plugin.html#id3)
```

#### 在 Linux 上编译 mmcv-full

| TODO: 视频教程

- 克隆算法库
- 克隆代码仓库

```bash
git clone https://github.com/open-mmlab/mmcv.git
cd mmcv
```

:::{note}
如果克隆算法库的速度过慢,可以使用以下命令克隆
如果克隆代码仓库的速度过慢,可以使用以下命令克隆

```bash
git clone https://gitee.com/open-mmlab/mmcv.git
Expand Down Expand Up @@ -91,15 +96,15 @@ python .dev_scripts/check_installation.py

| TODO: 视频教程以及 MPS 的编译步骤

- 克隆算法库
- 克隆代码仓库

```bash
git clone https://github.com/open-mmlab/mmcv.git
cd mmcv
```

:::{note}
如果克隆算法库的速度过慢,可以使用以下命令克隆
如果克隆代码仓库的速度过慢,可以使用以下命令克隆

```bash
git clone https://gitee.com/open-mmlab/mmcv.git
Expand Down Expand Up @@ -181,15 +186,15 @@ conda install pytorch torchvision cudatoolkit=10.2 -c pytorch
conda install pytorch torchvision cpuonly -c pytorch
```

- 克隆算法库
- 克隆代码仓库

```shell
git clone https://github.com/open-mmlab/mmcv.git
cd mmcv
```

:::{note}
如果克隆算法库的速度过慢,可以使用以下命令克隆
如果克隆代码仓库的速度过慢,可以使用以下命令克隆

```bash
git clone https://gitee.com/open-mmlab/mmcv.git
Expand Down Expand Up @@ -337,15 +342,15 @@ python .dev_scripts/check_installation.py

如果你需要使用和 PyTorch 相关的模块,请确保 PyTorch 已经成功安装在环境中,可以参考 [PyTorch 官方安装文档](https://github.com/pytorch/pytorch#installation)

- 克隆算法库
- 克隆代码仓库

```bash
git clone https://github.com/open-mmlab/mmcv.git
cd mmcv
```

:::{note}
如果克隆算法库的速度过慢,可以使用以下命令克隆
如果克隆代码仓库的速度过慢,可以使用以下命令克隆

```bash
git clone https://gitee.com/open-mmlab/mmcv.git
Expand Down
24 changes: 11 additions & 13 deletions docs/zh_cn/get_started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@
MMCV 有两个版本:

- **mmcv-full**: 完整版,包含所有的特性以及丰富的开箱即用的 CPU 和 CUDA 算子。注意完整版本可能需要更长时间来编译。
- **mmcv**: 精简版,不包含 CPU 和 CUDA 算子但包含其余所有特性和功能,类似 MMCV 1.0 之前的版本。如果你不需要使用 CUDA 算子的话,精简版可以作为一个考虑选项。
- **mmcv**: 精简版,不包含 CPU 和 CUDA 算子但包含其余所有特性和功能,类似 MMCV 1.0 之前的版本。如果你不需要使用算子的话,精简版可以作为一个考虑选项。

```{warning}
请不要在同一个环境中安装两个版本,否则可能会遇到类似 `ModuleNotFound` 的错误。在安装一个版本之前,需要先卸载另一个。`如果CUDA可用,强烈推荐安装mmcv-full`。
```

### 安装完整版 mmcv-full
### 安装 mmcv-full

```{important}
下述安装步骤仅适用于 Linux 和 Windows 平台,如需在 macOS 平台安装 mmcv-full,请参考[源码安装 mmcv-full](https://mmcv.readthedocs.io/zh_CN/latest/get_started/build.html#macos-mmcv-full)。
```{note}
1. 下述安装步骤仅适用于 Linux 和 Windows 平台,如需在 macOS 平台安装 mmcv-full,请参考[源码安装 mmcv-full](https://mmcv.readthedocs.io/zh_CN/latest/get_started/build.html#macos-mmcv-full)。
2. 如需编译 ONNX Runtime 自定义算子,请参考[如何编译ONNX Runtime自定义算子?](https://mmcv.readthedocs.io/zh_CN/latest/deployment/onnxruntime_op.html#id1)
3. 如需编译 TensorRT 自定义,请参考[如何编译MMCV中的TensorRT插件](https://mmcv.readthedocs.io/zh_CN/latest/deployment/tensorrt_plugin.html#id3)
```

在安装 mmcv-full 之前,请确保 PyTorch 已经成功安装在环境中,可以参考 [PyTorch 官方安装文档](https://github.com/pytorch/pytorch#installation)。可使用以下命令验证
Expand Down Expand Up @@ -47,7 +49,7 @@ mim install mmcv-full -i https://pypi.tuna.tsinghua.edu.cn/simple

安装完成后可以运行 [check_installation.py](https://github.com/open-mmlab/mmcv/.dev_scripts/check_installation.py) 脚本检查 mmcv-full 是否安装成功。

如果发现上述的安装命令没有使用 mmcv-full 预编译包安装,则表示没有提供对应 PyTorch 或者 CUDA 或者 mmcv-full 版本的预编译包,此时,请参考[源码安装 mmcv-full](https://mmcv.readthedocs.io/zh_CN/latest/get_started/build.html)
如果发现上述的安装命令没有使用 mmcv-full 预编译包安装,则可能是没有对应 PyTorch 或者 CUDA 或者 mmcv-full 版本的预编译包,那么,你可能需要[源码安装 mmcv-full](https://mmcv.readthedocs.io/zh_CN/latest/get_started/build.html)

#### 使用 pip 安装

Expand Down Expand Up @@ -121,7 +123,7 @@ pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu111/torch1.9

:::

如果上面的下拉框中没有找到对应的版本,则表示没有提供对应 PyTorch 或者 CUDA 或者 mmcv-full 版本的预编译包,此时,请参考[源码安装 mmcv-full](https://mmcv.readthedocs.io/zh_CN/latest/get_started/build.html)
如果上面的下拉框中没有找到对应的版本,则可能是没有对应 PyTorch 或者 CUDA 或者 mmcv-full 版本的预编译包,那么,你可能需要[源码安装 mmcv-full](https://mmcv.readthedocs.io/zh_CN/latest/get_started/build.html)

#### 使用 docker 镜像

Expand Down Expand Up @@ -158,14 +160,10 @@ docker build -t mmcv -f docker/release/Dockerfile \

更多 PyTorch 和 CUDA 镜像可以点击 [dockerhub/pytorch](https://hub.docker.com/r/pytorch/pytorch/tags)

### 安装精简版 mmcv
### 安装 mmcv

如果你需要使用和 PyTorch 相关的模块,请确保 PyTorch 已经成功安装在环境中,可以参考 [PyTorch 官方安装文档](https://github.com/pytorch/pytorch#installation)

```python
pip install mmcv
```

### 安装完整版并且编译 onnxruntime 的自定义算子

详细的指南请查看 [这里](https://mmcv.readthedocs.io/zh_CN/latest/deployment/onnxruntime_custom_ops.html)

如果想从源码编译 MMCV,请参考[该文档](https://mmcv.readthedocs.io/zh_CN/latest/get_started/build.html)

0 comments on commit 865261d

Please sign in to comment.