1.创建工作环境
conda create -n open-mmlab python=3.7 -y
conda activate open-mmlab
2.安装pytorch, torchvision and cudatoolkit,要指定cudatoolkit和pytorch的版本
conda install pytorch=1.6 cudatoolkit=10.1 torchvision
3.安装mmcv-full
pip install mmcv-full==latest+torch1.6.0+cu101 -f https://openmmlab.oss-accelerate.aliyuncs.com/mmcv/dist/index.html
4.安装mmdetection
git clone https://github.com/open-mmlab/mmdetection.git
cd mmdetection
pip install -r requirements/build.txt
pip install -v -e . # or "python setup.py develop"
参考文献:
https://github.com/open-mmlab/mmdetection/blob/master/docs/install.md