确保cuda版本 >= 11.x
①创建环境
conda create -n open-mmlab python=3.7 -y
conda activate open-mmlab
②下载pytorch 可以从官网上获取版本和连接,但是如果你比较懒,直接用我的。
输入命令后,注意看conda的提示,pytorch版本要显示cuda或者gpu!
如果显示的torch为cpu版本,后续能有可能无法正确调用cuda!
错误的原因在于官网的源或者你指定的源中没有合适的torch gpu版本的资源,自动下载了cpu版本的资源!需要去镜像源的网站中确认是否有该版本的gpu资源!如果你想偷懒,直接使用我的命令。
pip install torch==1.12.0+cu113 torchvision==0.13.0+cu113 torchaudio==0.12.0 --extra-index-url https://download.pytorch.org/whl/cu113
③MMDetection
pip install openmim
mim install mmdet
④安装mmcv-full
pip install mmcv-full==1.6.0 -f https://download.openmmlab.com/mmcv/dist/cu113/torch1.12/index.html
⑤从github获取mmdetection工程