README.md 2.15 KB
Newer Older
xiabo's avatar
xiabo committed
1
# <div align="center"><strong>MMCV</strong></div>
xiabo's avatar
xiabo committed
2
## 简介
dcuai's avatar
dcuai committed
3
MMCV是计算机视觉研究的基础库,主要提供以下功能:图像处理、图像和标注结果可视化、图像转换、多种CNN网络结构、高质量实现的常见CUDA算子。
xiabo's avatar
xiabo committed
4
5

## 安装
dcuai's avatar
dcuai committed
6
7
组件支持
+ Python 3.7、3.8、3.9
xiabo's avatar
xiabo committed
8

dcuai's avatar
dcuai committed
9
### 1、使用pip方式安装
huchen's avatar
huchen committed
10
mmcv whl包下载目录:[https://cancon.hpccube.com:65024/4/main/mmcv/dtk23.04](https://cancon.hpccube.com:65024/4/main/mmcv/dtk23.04),选择对应的pytorch版本和python版本下载对应mmcv的whl包
xiabo's avatar
xiabo committed
11
12
```shell
pip install mmcv* (下载的mmcv的whl包)
13
```
dcuai's avatar
dcuai committed
14
### 2、使用源码编译方式安装
15

xiabo's avatar
xiabo committed
16
#### 编译环境准备
huchen's avatar
huchen committed
17
提供2种环境准备方式:
xiabo's avatar
xiabo committed
18

huchen's avatar
huchen committed
19
1. 基于光源pytorch基础镜像环境:镜像下载地址:[https://sourcefind.cn/#/image/dcu/pytorch](https://sourcefind.cn/#/image/dcu/pytorch),根据pytorch、python、dtk及系统下载对应的镜像版本。
xiabo's avatar
xiabo committed
20

huchen's avatar
huchen committed
21
2. 基于现有python环境:安装pytorch,pytorch whl包下载目录:[https://cancon.hpccube.com:65024/4/main/pytorch/dtk23.04](https://cancon.hpccube.com:65024/4/main/pytorch/dtk23.04),根据python、dtk版本,下载对应pytorch的whl包。安装命令如下:
xiabo's avatar
xiabo committed
22
23
```shell
pip install torch* (下载的torch的whl包)
xiabo's avatar
xiabo committed
24
pip install setuptools==59.5.0 wheel
Zaida Zhou's avatar
Zaida Zhou committed
25
26
```

xiabo's avatar
xiabo committed
27
28
#### 源码编译安装
- 代码下载
xiabo's avatar
xiabo committed
29
```shell
xiabo's avatar
xiabo committed
30
git clone https://developer.hpccube.com/codes/aicomponent/mmcv # 根据编译需要切换分支
xiabo's avatar
xiabo committed
31
```
huchen's avatar
huchen committed
32
- 提供2种源码编译方式(进入mmcv目录):
xiabo's avatar
xiabo committed
33
```
huchen's avatar
huchen committed
34
1. 编译whl包并安装
xiabo's avatar
xiabo committed
35
36
MMCV_WITH_OPS=1 ROCM_HOME=${ROCM_PATH} python3 setup.py -v bdist_wheel
pip install dist/mmcv*
xiabo's avatar
xiabo committed
37

huchen's avatar
huchen committed
38
2. 源码编译安装
xiabo's avatar
xiabo committed
39
MMCV_WITH_OPS=1 ROCM_HOME=${ROCM_PATH} python3 setup.py install
Zaida Zhou's avatar
Zaida Zhou committed
40
```
dcuai's avatar
dcuai committed
41
#### 注意事项
dcuai's avatar
dcuai committed
42
43
+ 若使用pip install下载安装过慢,可添加pypi清华源:-i https://pypi.tuna.tsinghua.edu.cn/simple/
+ ROCM_PATH为dtk的路径,默认为/opt/dtk
xiabo's avatar
xiabo committed
44

dcuai's avatar
dcuai committed
45
## 验证
huchen's avatar
huchen committed
46
- python -c "import mmcv; mmcv.\_\_version__",版本号与官方版本同步,查询该软件的版本号,例如2.0.0;
Zaida Zhou's avatar
Zaida Zhou committed
47

huchen's avatar
huchen committed
48
49
## Known Issue
-
xiabo's avatar
xiabo committed
50

dcuai's avatar
dcuai committed
51
## 参考资料
xiabo's avatar
xiabo committed
52
- [README_ORIGIN](README_ORIGIN.md)
huchen's avatar
huchen committed
53
- [README_zh-CN](README_zh-CN.md)
dcuai's avatar
dcuai committed
54
- [https://github.com/open-mmlab/mmcv](https://github.com/open-mmlab/mmcv)