pointpillar推理部署——实现激光雷达点云目标识别

openpcdet
参考库:https://github.com/windzu/pointpillars/tree/4137ca5c0726f767b3f8f5b0352ddfca13594a87?tab=readme-ov-file

这个是之前做过的一个工作,这里重新温故知新。
环境准备:cuda-11.3,python3.8,cudnn8.2.1 torch==1.11.0
主要是cuda和cudnn,都是必需的.
创建虚拟环境

conda create -n det3d  python=3.8
conda activate det3d

安装python依赖包

pip install spconv pyyaml scikit-image onnx onnx-simplifier onnx_graphsurgeon msvcrt numba spconv-cu118
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118

安装Openpcdet的库

git clone https://github.com/open-mmlab/OpenPCDet.git
cd OpenPCDet
python setup.py develop

问题1:

Traceback (most recent call last):
  File "setup.py", line 5, in <module>
    from torch.utils.cpp_extension import BuildExtension, CUDAExtension
  File "/home/cyun/.local/lib/python3.8/site-packages/torch/__init__.py", line 290, in <module>
    from torch._C import *  # noqa: F403
ImportError: libcudnn.so.9: cannot open shared object file: No such file or directory

这是应为torch的版本太高了,cuda11.8无法使用,先卸载原有的torch相关的内容,然后重新安装:pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
开始安装后:
在这里插入图片描述
安装完成之后:
在这里插入图片描述
克隆源码

git clone https://github.com/windzu/pointpillars.git

这里注意,只有pointpillar_ws是工作空间,其他都是一些工具,所以先进入pointpillar_ws.接着修改工作空间的cmakelists.txt:
在这里插入图片描述
然后正常编译即可:
在这里插入图片描述

编译完成之后,准备一下预训练模型,然后就可以运行了:

roslaunch det3d det3d.launch

出现问题在这里插入图片描述
这里还是没有找到tensorRT的动态依赖,只能一点一点给他添加一下,在另外一个cmakelist中:
在这里插入图片描述
改为:
在这里插入图片描述
并且注意自己的.bashrc添加了tensorrt的路径,也就是:
在这里插入图片描述
然后就能正常使用了:

roslaunch det3d det3d.launch

在这里插入图片描述
这个是eigen模型有问题,由于我的版本有问题所以需要先对模型进行一个重新转换,也就是要严格按照这个环境:
环境 OS GPU CUDA CUDNN Tensorrt
环境一 Ubuntu20.04 RTX2080 11.3 8.2.1 GA8.0
tensorrt要求没有那么高,但是cuda cudnn比较重要,然后torch是1.11.0

然后去转换模型到onxx中:

python exporter.py --ckpt ./last_model.pth

在这里插入图片描述

然后放到model中:
在这里插入图片描述
这样就能正常使用了.播放一下雷达的包就能进行识别了.

后续待做:由于我没有按照原本的环境进行安装,所以无法使用他的last_model,所以可能还会继续去寻找如何训练一个pointpillar的模型.后续再更新这部分

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

白云千载尽

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值