记录自本人安装过程,环境建议:
Linux or macOS (Windows is not currently officially supported)Python 3.6+PyTorch 1.3+CUDA 9.2+ (If you build PyTorch from source, CUDA 9.0 is also compatible)GCC 5+我使用的是 torch 1.5.1 + torchvision 0.6.1
pip install torch==1.5.1 torchvision==0.6.1 [-i https://pypi.douban.com/simple]
https://pytorch.org/get-started/previous-versions/
pip install mmcv-full
下载数据
mkdir checkpoints wget -c https://open-mmlab.s3.ap-northeast-2.amazonaws.com/mmdetection/v2.0/mask_rcnn/mask_rcnn_r50_caffe_fpn_mstrain-poly_3x_coco/mask_rcnn_r50_caffe_fpn_mstrain-poly_3x_coco_bbox_mAP-0.408__segm_mAP-0.37_20200504_163245-42aa3d00.pth \ -O checkpoints/mask_rcnn_r50_caffe_fpn_mstrain-poly_3x_coco_bbox_mAP-0.408__segm_mAP-0.37_20200504_163245-42aa3d00.pth此时查看文件目录树如下
> tree checkpoints checkpoints └── mask_rcnn_r50_caffe_fpn_mstrain-poly_3x_coco_bbox_mAP-0.408__segm_mAP-0.37_20200504_163245-42aa3d00.pth运行image_demo.py测试mmdet是否安装成功
python demo/image_demo.py demo/demo.jpg configs/mask_rcnn/mask_rcnn_r50_caffe_fpn_mstrain-poly_3x_coco.py checkpoints/mask_rcnn_r50_caffe_fpn_mstrain-poly_3x_coco_bbox_mAP-0.408__segm_mAP-0.37_20200504_163245-42aa3d00.pth若安装成功,会显示如下图像:
先卸载原有cudatoolkit:conda uninstall cudatoolkit
再安装10.1版本:conda install cudatoolkit=10.1