基于深度学习CenterPoint的3D目标检测部署实战

1.所用硬件

硬件:英伟达 Jetson AGX

环境:ubuntu 20.04

2.安装依赖

yaml 复制代码
CUDA Toolkit: 11.4
python: 3.8
numpy: 1.23.1
pytorch: 2.0.0
ros: notic
rospkg
ros_numpy:  (sudo apt-get install ros-$ros_release-ros-numpy)
pyyaml
argparse

2.拉取代码

bash 复制代码
git clone https://gitee.com/uuuu_qqq/livox_detection.git

cd livox_detection

python3 setup.py develop

3.解决部署过程遇到的bug

3.1 EasyInstallDeprecationWarning: easy_install command is deprecated.

解决EasyInstallDeprecationWarning: easy_install command is deprecated.

3.2 torch cuda版本安装

NVIDIA 优化框架:Jetson 平台 PyTorch 安装指南

3. 3 ModuleNotFoundError: No module named 'ros_numpy'

sudo apt-get install ros-noetic-ros-numpy

遇到下面问题:

bash 复制代码
http://mirrors.tuna.tsinghua.edu.cn/ros/ubuntu/pool/main/r/ros-noetic-ros-numpy/ros-noetic-ros-numpy_0.0.5-2focal.20250510.062009_arm64.deb

E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

于是直接复制下载链接,到官网下载,然后本地安装:

sudo dpkg -i ros-noetic-ros-numpy_0.0.5-xxxxx_arm64.deb

3. 4 AttributeError: module 'numpy' has no attribute 'float'.

bash 复制代码
raise AttributeError(__former_attrs__[attr])
AttributeError: module 'numpy' has no attribute 'float'.
`np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.

只需要找到对应代码,把np.float改为float或者np.int改为int;

4.开始执行

  1. 运行 ROS.

    bash 复制代码
    roscore
  2. 进入 'tools' 目录并运行 test_ros.py(预训练模型:.../pt/livox_model_1.pt 或 .../pt/livox_model_2.pt)

    bash 复制代码
    cd tools
    python3 test_ros.py --pt ../pt/livox_model_1.pt
  3. 播放rosbag。 (pointcloud 2的主题应该是/livox/lidar,或者自己在代码里改一下,直接接雷达数据也可以,话题类型要一致)

    bash 复制代码
    rosbag play [bag path]
  4. rviz可视化.

    bash 复制代码
    rviz -d rviz.rviz
相关推荐
阳光是sunny20 小时前
别再被 worktree 绕晕了!AI 编程时代你必须掌握的 Git 隔离神器
前端·人工智能·后端
冬奇Lab20 小时前
每日一个开源项目(第148篇):obsidian-skills - Obsidian CEO 亲写的 AI Agent 格式规范,让 Agent 不再破坏你的 Vault
人工智能·开源·资讯
ethantan20 小时前
AI Agent 组成:像人一样思考的智能体
人工智能·程序员·架构
冬奇Lab20 小时前
Workflow 系列(05):评测体系——三层测试结构与 Trace 追踪
人工智能·工作流引擎
ethantan21 小时前
一篇讲解AI Agent 组成:像人一样思考的智能体
人工智能·后端·程序员
Cosolar1 天前
vLLM 生产级部署完全指南
人工智能·后端·架构
CodePlayer竟然被占用了1 天前
被美国政府封杀18天,Claude Fable 5 回来了——但代价是什么?
人工智能
IT_陈寒1 天前
垃圾回收器选错了,我的Java服务内存炸了
前端·人工智能·后端
smartpi1 天前
SmartPi GPIO 脉冲与回复语执行时序指南
人工智能
阿里云大数据AI技术1 天前
PAI支持一键部署GLM-5.2,Coding能力比肩Claude Opus 4.8
人工智能