首先创建一个虚拟环境
conda create -n open-mmlab python=3.7 -y
conda activate open-mmlab
可以参考mmsegmention的官网安装文档
- 首先安装pytorch框架(GPU)
pip install torch1.9.0+cu111 torchvision0.10.0+cu111 torchaudio==0.9.0 -f https://download.pytorch.org/whl/torch_stable.html
pip install torch==1.9.0+cu111 torchvision==0.10.0+cu111 torchaudio==0.9.0 -f https://download.pytorch.org/whl/torch_stable.html
- 安装依赖open-mmlab
为了安装 MMCV, 我们推荐使用下面的这种预编译好的 MMCV.
pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/{cu_version}/{torch_version}/index.html
例如 pip install mmcv-full==1.4.0 -f https://download.openmmlab.com/mmcv/dist/cu111/torch1.9.0/index.html
pip install mmcv-full==1.4.0 -f https://download.openmmlab.com/mmcv/dist/cu111/torch1.9.0/index.html
- 编译mmsegmentaion
git clone https://github.com/open-mmlab/mmsegmentation.git
cd mmsegmentation
pip install -e .
|