工具/软件:
我正在使用的器件 edgeai-tidl-tools 标签 10_00_08_00 并尝试编译基于 YOLOv8 的定制模型。
我准备了 20 张校准图像。 我的.pt模型已转换为具有以下参数的 ONNX:
-
dynamic = False -
opset = 12 -
simplify = True
以下是我添加的模型配置:
“Od-custom_yolov8n_608":“:create_model_config (
Source=dict(
model_url=“",“,</s>、
meta_arch_url=“{path}/edgeai-tidl-tools/examples/models/prototxt/yolo/yolov8_small_lite_640x640_20231117_model.prototxt、
推断形状=假、
)、
preproception=dict(
调整大小=608、
作物=608、
data_layout=“NCHW",“,</s>、
REVERSE_CHANNES=True、
resize_with_pad=[True、“Cornor"],“,</s>、
PAD_COLOR=[114,114,114]、
)、
Session=dict(
session_name=“onnxrt",“,</s>、
model_path='{model_path}/best.onnx'、
meta_layers_names_list=“{path}/edgeai-tidl-tools/examples/models/prototxt/yolo/yolov8_small_lite_640x640_20231117_model.prototxt、
META_ARCH_TYPE=6、# YOLO 系列
input_mean=[0.0、0.0、0.0]、
INPUT_SCALE=[0.003921568627、0.003921568627、0.003921568627]、
Input_optimization=True、
INPUT_SHAPE=[1、3,608,608]、
)、
postprocess = dict (
格式化板=“DetectionBoxSL2BoxLS",“,</s>、
resize_with_pad=True、
关键点=False、
object6dpose=False、
归一化检测=错误、
shuffle_indices=None、
挤压轴=无、
rempe_list=[(–1、5)、(–1、1)]、
IGNORE_INDEX=None、
)、
task_type=“detection",“,</s>、
extra_info=dict (
OD_TYPE=“Yolov8",“,</s>、
framework=“Ultralytics",“,</s>、
num_images=20、#校准图像
NUM_CLASS=2、
label_offset_type=“default",“,</s>、
LABEL_OFFSET=0、
),)
问题:
使用以下器件运行编译时:
python3 onnxrt_ep.py -c -m od-custom_yolov8n_608x608
我在量化和校准过程中得到以下误差:
2025年08月06日 17:08:12.435674125 [E:onnxruntime:、SEQUENCE_executor.cc:494 ExecuteKernel]
运行 ReorderInput 节点时返回非零状态代码。
名称:“ReorderInput"</s>“
状态消息:/root/onnxruntime/onnxruntime/contrib_ops/cpu/nchwc_ops.cc:17
虚拟 onnxruntime::common::Status onnxruntime::contrib::ReorderInput::Compute (
onnxruntime::OpKernelContext*) const
x_rank == 4 为 false。
流程回溯结束于:
onnxruntime_pybind11_state.RuntimeException :[ONNXRuntimeError]: 6 : runtime_exception
运行 ReorderInput 节点时返回非零状态代码。
我看到:
MEM:Deinit ...完成了!!!
此时、该进程未完全退出—它将挂起。
观察结果:
如果使用-d以下选项禁用卸载:
python3 onnxrt_ep.py -c -m od-custom_free_smoke_yolov8n_608x608 -d
在 CPU 回退时成功运行:
Completed_Model:1、名称:od-custom_freeSmoy_yolov8n_608x608.
总时间:157.87,卸载时间:0.00, DDR RW MB:0
输出图像文件:py_out_od-custom_yolov8n_608x_...
输出 Bin 文件:py_out_od-custom_yolov8n_608x_...
问题:
-
ReorderInput启用卸载时、为什么编译会因秩错误而失败? -
我的 ONNX 导出、模型配置或校准设置是否有问题?
-
我是否需要调整输入形状 (608x608) 或删除
meta_arch_url条目,因为 YOLOv8 通常不需要 prototxt? - 另外、我目前正在使用中的 prototxt 文件
edgeai-tidl-tools/examples/models/prototxt/yolo/yolov8_small_lite_640x640_20231117_model.prototxt。 是否可以按原样使用此协议?
欢迎提供有关如何解决此错误的任何指导。
