yolov5x 再训练后,如何进行模型转换

用户您好,请详细描述您所遇到的问题,这会帮助我们快速定位问题~

1.芯片型号:J5

2.天工开物开发包OpenExplorer版本:j5_open_explorer_v1.1.57

3.问题定位:例如模型转换

4.问题具体描述

我下载了v2.0的yolov5x.pt,然后生成了best.pt,之后尝试转换onnx格式

发现leakyrelu 被替换为sigmoid,而且不容易更改输出节点按照1.3、1.4不太明白

请问是否可以提供详细操作方式

1.3 after download, convert pt file into ONNX file using the `https://github.com/ultralytics/yolov5/blob/v2.0/models/export.py\` script

1.4 As for YOLOv5 model, in terms of model structure, we modified some output nodes. As currently OpenExplorer XJ3 Toolchain doesn’t support 5-dimensional Reshape, we deleted it in the prototxt and moved it to post-process. Meanwhile, we’ve aslo added a transpose operator to enable the node to dump NHWC. This is because in Horizon’s ASIC, BPU hardware runs NHWC layout, therefore, BPU can directly dump results after some modifications, rather than introducing additional transpose in quantized model. For more details please refer to the text and table in the Benchmark section.

参考

https://developer.horizon.ai/api/v1/fileData/doc/ddk\_doc/navigation/ai\_toolchain/docs\_cn/hb\_mapper\_sample\_doc/samples/algorithm\_sample.html#yolov5s

你好,走PTQ后量化模型转换,模型训练使用公开训练方法即可,还没有用到地平线的工具链哈~

我希望我训练后的best.pt export onnx, 和地平线官方给的model_zoo里的yolov5 onnx 一致

这样可以安全的用例子的PTQ脚本做量化

建议搜一下,社区上很多yolov5的帖子哈,B站上还有视频:地平线机器人平台应用系列-yolov5全流程部署_哔哩哔哩_bilibili

谢谢。。