2021-06-06

安装mmdetection3d`

1.创建虚拟环境
conda create -n env_name python=3.7 -y
conda activate env_name

2.安装对应版本的pytorch
pytorch官网安装页面
查看cuda版本
nvidia-smi
nvcc -V

我的cuda11.1安装pytorch
pip install torch1.8.0+cu111 torchvision0.9.0+cu111 torchaudio0.8.0 -f https://download.pytorch.org/whl/torch_stable.html
验证:
python
import torch, torchvision
print(torch.version, torch.cuda.is_available())
3.安装mmcv
然后把自己的cuda和torch的版本号替换即可,我的环境对应的具体命令为:
pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/{cu_version}/{torch_version}/index.html
pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu101/torch1.8.0/index.html
4.安装MMDetection。
pip install git+https://github.com/open-mmlab/mmdetection.git
(可选)如果需要修改代码,也可以从源代码构建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”
5.install mmdetection3d
git clone https://github.com/open-mmlab/mmdetection3d.git
cd mmdetection3d
pip install -v -e . # or “python setup.py develop”
编译的时候,我建议你使用命令:python setup.py develop
6.另外还需要安装以下依赖库
pip install pytest-runner -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip install mmsegmentation
0.13.0
pip install ipython==7.24.1

以上安装方式,经过测试,pytorch1.7.1和1.8.0版本的都可以成功运行

你可能感兴趣的:(pytorch,自动驾驶)