我来帮你分析这个问题。从日志看,系统实际在运行,但没有加载你指定的 yolo11 模型,而是用了默认的 fcos 模型。
问题定位
日志中关键信息:
model_file_name: /opt/hobot/model/x5/basic/fcos_512x512_nv12.bin # 默认模型
model_name: fcos_efficientnetb0_512x512_nv12
但你启动命令指定的是:
model_config_file:=/home/sunrise/yiqiang_ws/src/origincar/models/yolo11workconfig.json
排查步骤
1. 检查 yolo11workconfig.json 内容
cat /home/sunrise/yiqiang_ws/src/origincar/models/yolo11workconfig.json
确认文件中 model_file_name 指向正确的 bin 文件路径。
2. 检查 launch 文件参数传递
查看 usb_websocket_display.launch.py 是否正确接收并使用 model_config_file 参数:
cat ~/yiqiang_ws/src/origincar/origincar_bringup/launch/usb_websocket_display.launch.py
关键看 dnn_example_node 是否使用了传入的 config 文件。
3. 验证 bin 文件是否存在
ls -la /opt/hobot/model/x5/basic/yolo11*.bin
# 或你配置中指定的路径
4. 常见原因
| 原因 | 检查方法 |
|---|---|
| config 文件中模型路径错误 | 打开 json 检查 model_file_name |
| launch 文件未使用传入参数 | 检查 launch 文件中参数声明 |
| bin 文件不存在 | ls 确认文件存在 |
| 模型平台不匹配 | 确认是 x5 平台模型 |
临时解决方案
直接修改 launch 文件中的默认 config 路径,或检查你的 json 配置:
{
"model_file_name": "/path/to/your/yolo11.bin",
...
}
请先确认以下两点:
yolo11workconfig.json里的model_file_name路径是否正确?- 该 bin 文件在开发板上是否存在?
把这两个信息发我,我再帮你进一步定位。同时建议搜索社区看看是否有类似部署问题:
问题分析
从日志和测试结果看,你的模型输出结构正确(6个输出头,NCHW格式),但存在两个关键问题:
核心问题
| 问题 | 你的情况 | 影响 |
|---|---|---|
| 版本不兼容 | 模型编译版本 3.15.55.0 vs 运行时 3.15.54.0 | |
| 测试方法不对 | 官方测试用MIPI相机,你用的是USB相机 | 测试失败是相机问题,不是模型问题 |
解决方案(按优先级)
方案1:升级板子系统(推荐)
# 1. 检查当前系统版本
sudo rdkos_info
# 2. 升级系统
sudo srpi-config
# 选择:1-SystemOptions → S7-UpdateMiniBoot
# 3. 重启
sudo reboot
# 4. 升级后验证
python3 -c "from hobot_dnn import pyeasy_dnn as dnn; print('OK')"
方案2:用USB相机测试官方模型
你之前测试失败是因为默认用了MIPI相机,需要用USB相机参数:
# 使用USB相机测试官方模型
export CAM_TYPE=usb
ros2 launch dnn_node_example dnn_node_example.launch.py
如果这个能跑,说明系统正常,是你的模型版本问题。
方案3:重新量化模型(如果无法升级)
在你的板子上用当前工具链重新量化:
# 查看板子工具链版本
hb_mapper --version
# 按照教程重新量化
# 参考:https://forum.d-robotics.cc/t/topic/34084
快速诊断流程
# 步骤1:用USB相机测试官方模型(5分钟)
export CAM_TYPE=usb
ros2 launch dnn_node_example dnn_node_example.launch.py
# 步骤2:如果成功,测试你的模型
ros2 launch origincar_bringup usb_websocket_display.launch.py \
dnn_example_config_file:=/home/sunrise/yiqiang_ws/src/origincar/models/yolo11workconfig.json
# 步骤3:查看结果
# - 如果步骤1成功,步骤2失败 → 模型版本问题,需要升级或重新量化
# - 如果步骤1也失败 → 系统环境问题,需要升级系统
配置文件检查
确保你的 yolo11workconfig.json 配置正确:
{
"model_file": "/home/sunrise/yiqiang_ws/src/origincar/models/obstacle.bin",
"dnn_Parser": "yolov8",
"model_output_count": 6,
"reg_max": 16,
"class_num": 1,
"cls_names_list": "/home/sunrise/yiqiang_ws/src/origincar/models/obstacles.list",
"strides": [8, 16, 32],
"score_threshold": 0.25,
"nms_threshold": 0.7,
"nms_top_k": 300
}
下一步
请先执行快速诊断流程的步骤1,把结果贴出来:
- 如果官方模型能跑 → 我们解决模型版本问题
- 如果官方模型也崩溃 → 需要升级系统
相关资源: