安装mmdetection3d看一篇就够了
一、介绍
伴随着自动驾驶科技的飞速发展和激光雷达的普及,3D目标检测近年来逐渐成为业界和学术界的研究热点。然而,目前在3D目标检测领域却不像2D目标检测那样,有着像MMDetection这样简单通用的代码库和benchmark。最近在看一些基于点云3d目标检测的文章,需要复现甚至修改一些算法,就找到了mmlab开源的mmdetection3d目标检测框架,方便后续学习。
在安装的时候遇到一点坑,比如环境问题,安装完能跑demo但是不能跑训练测试问题等。在解决问题后还是完成了安装。在这里记录一下正确的安装流程,已备再次查阅,也给大家提供一点参考。
一、我的环境配置(PyTorch 1.8.1 Python 3.8 (ubuntu18.04) Cuda 11.1,血泪安装亲测有效)
conda install pytorch==1.8.1 torchvision==0.9.1 torchaudio==0.8.1 cudatoolkit=11.3 -c pytorch -c conda-forge pip install mmcv-full==1.3.8 pip install mmdet==2.14.0 pip install mmsegmentation==0.14.1 git clone https://github.com/openmmlab/mmdetection3d cd mmdetection3d git checkout v0.17.1 pip install -e .
试了很多种排列组合,
pytorch==1.8.1 但是Cuda 13.1的时候,显示torch版本太低,不能匹配Cuda
pytorch==1.10.1 但是Cuda 13.1的时候, 此时也没有对于的mmcv版本,因为 1.3.8=<mmcv<=1.4.0
记得注意的是:pytorch==1.8.1对应的Cuda是11.X, 而显卡40系列最低要求是13.1
所以安装的时候不止是要求各种包的版本,还需要看显卡的信息
- 不要问其他版本能不能通,小白和不想折腾环境的童鞋直接抄作业
- 默认显卡驱动
cuda,cudnn,conda
已装好,未安装请参考cuda, cudnn,conda安装
我租用的服务器配置
成功安装好mmdetection3d
具体安装步骤
# 1 创建虚拟环境
conda create -n bev python=3.8 -y
# 2 激活虚拟环境
conda activate bev
# 3.1 直接安装
conda install pytorch==1.8.1 torchvision==0.9.1 torchaudio==0.8.1 cudatoolkit=11.3 -c pytorch -c conda-forge
# 3.2 建议先下载轮子,在直接pip install xxxxx.whl 会更安心!!!
下面是下载pytorch==1.8.1 torchvision==0.9.1轮子地址:
https://download.pytorch.org/whl/torch_stable.html
# 4 gcc版本 可选
conda install -c omgarcia gcc-6 # gcc-6.2
# 5 mmopenlib系列 mmcv-full会装很久,只要电脑没卡住都是正常现象
# 5.1mmcv-full建议也使用轮子下载,下面是对应网址
https://download.openmmlab.com/mmcv/dist/cu111/torch1.8.0/index.html
https://download.openmmlab.com/mmcv/dist/cu[版本]/torch[版本]/index.html
# 5.2 直接pip下载:
pip install mmdet==2.14.0
pip install mmsegmentation==0.14.1
# 6 源码安装mmdet3d-v0.17.1版本
# 6.1 下载mmdetection3d github加速代理https://ghproxy.com/
git clone https://github.com/open-mmlab/mmdetection3d.git
# 6.2 进入mmdetection3d目录 cd mmdetection3d
pip install -e .