OpenPCDet配置安装记录

一、前言

OpenPCDet是一套基于PyTorch实现的点云3D目标检测代码库
本次实验主要的介绍和参考:https://zhuanlan.zhihu.com/p/152120636
https://blog.csdn.net/W1995S/article/details/114597797
https://blog.csdn.net/QLeelq/article/details/120994231
https://github.com/traveller59/spconv
https://github.com/open-mmlab/OpenPCDet/blob/master/docs/INSTALL.md
https://blog.csdn.net/weixin_42905141/article/details/124515876#t11
本机环境:1.ubuntu20
2.cuda11.1
3.3060ti
4.pytorch==1.9.0+cu111

二、安装spconv

spconv:空间稀疏卷积库
github的链接:https://github.com/traveller59/spconv
根据自己的配置来安装
在这里插入图片描述
输入指令:

nvcc -V

查看cuda版本选择对应版本安装
在这里插入图片描述
测试是否安装成功

python3
import spconv

不报错就是安装成功
在这里插入图片描述

三、安装openPCDet

1.下载源码

git clone https://github.com/open-mmlab/OpenPCDet.git

2.安装

cd OpenPCDet
pip install -r requirements.txt
python3 setup.py develop

遇到的问题
问题1

ERROR: numba 0.55.1 has requirement numpy<1.22,>=1.18, but you'll have numpy 1.22.2 which is incompatible.

原因是numpy版本不匹配。
解决方法:

sudo pip uninstall numpy
pip install -r requirements.txt

问题2
输入:python3 setup.py develop时

Traceback (most recent call last):
  File "setup.py", line 8, in <module>
    from torch.utils.cpp_extension import BuildExtension, CUDAExtension
ModuleNotFoundError: No module named 'torch'

解决方法:

python3 setup.py develop --user

3.验证

python3
import pcdet

没报错就可以
在这里插入图片描述

四、安装open3d

pip3 install open3d
速度慢的话用国内镜像
pip3 install open3d -i https://pypi.tuna.tsinghua.edu.cn/simple

五、下载kitti的3D数据集

1.下载数据集
下载链接:http://www.cvlibs.net/datasets/kitti/eval_object.php?obj_benchmark=3d
在这里插入图片描述
参考:https://blog.csdn.net/weixin_42905141/article/details/124515876#t11
这位大兄弟分享了百度云。

2.解压并排序
下载好数据集后,解压压缩包,会出现training和testing文件夹,将每一个压缩包解压后的文件夹置于data/kittit文件夹下。在这里插入图片描述
在这里插入图片描述

3.测试
前面因为没有bin的雷达数据,现在有数据了,测试一下。
在tools文件夹下,摆放如下文件
在这里插入图片描述
修改demo.py文件中

def parse_config():
    parser = argparse.ArgumentParser(description='arg parser')
    parser.add_argument('--cfg_file', type=str, default='cfgs/kitti_models/pv_rcnn.yaml',
                        help='specify the config for demo')
    parser.add_argument('--data_path', type=str, default='000000.bin',
                        help='specify the point cloud data file or directory')
    parser.add_argument('--ckpt', type=str, default='pv_rcnn_8369.pth', help='specify the pretrained model')
    parser.add_argument('--ext', type=str, default='.bin', help='specify the extension of your point cloud data file')

    args = parser.parse_args()

运行代码效果
在这里插入图片描述
遇到的问题:
ImportError: numpy.core.multiarray failed to import
解决方法:
参考:https://github.com/open-mmlab/OpenPCDet/issues/867
主要是版本对应问题,我使用别人的版本对应还是出现问题了,后面继续补充安装SharedArray后解决问题。

猜你喜欢

转载自blog.csdn.net/weixin_41868104/article/details/124836118