安装anaconda、cuda11.1、gcc-9.5.0、pytorch1.9.1
conda create -n pcdet python=3.8 -y #创建python3.8虚拟环境
conda activate pcdet
pip install torch==1.9.1+cu111 torchvision==0.10.1+cu111 torchaudio==0.9.1 -f https://download.pytorch.org/whl/torch_stable.html #安装对应版本pytorch
pip install spconv-cu111 #pip自动安装对应版本
git clone https://github.com/open-mmlab/OpenPCDet.git
cd OpenPCDet
pip install -r requirements.txt # 注意安装pip install kornia==0.6.5
python setup.py develop
选择安装pytorch版本最低1.9.1否则之后无法匹配所需安装的kormia包。
在执行pip install -r requirement.txt安装所需包时,如果出现错误,无法安装某个包,手动pip安装,或添加镜像源。 pip install (例如 numba) -i https://pypi.tuna.tsinghua.edu.cn/simple
在安装时先检查gcc版本是否正确。
gcc -v
版本不匹配在执行python setup.py develop 时可能会出现错误。
#error -- unsupported GNu version! gcc versions later than 10 are not supported! The nvcc flag '-allow-unsupported-compiler' can be used to override this version check; however , using an unsupported host compiler may cause compilation failure or incorrect run time execution. Use at your own risk.
版本过高出现问题,可以先卸载高版本重新安装gcc-9.5.0版本。
sudo apt-get remove gcc
sudo apt autoremove
安装gcc-9.5.0
sudo apt-get install gcc-9
安装g++-9.5.0
sudo apt-get install g++-9
构建软连接
sudo ln -s /usr/bin/gcc-9 /usr/bin/gcc
sudo ln -s /usr/bin/g++-9 /usr/bin/g++
重新执行python setup.py develop
可能出现问题cuda在上一过程中被卸载,重新安装cuda11.1即可。
若出现 subprocess.CalledProcessError:Command【‘which’,‘c++’】returned non-zero exit status 1错误。
创建符号连接, sudo ln -s /usr/bin/g++ /usr/bin/c++
再次重新执行python setup.py develop
成功截图。