PaddlePaddle / PaddleDetection

Object Detection toolkit based on PaddlePaddle. It supports object detection, instance segmentation, multiple object tracking and real-time multi-person keypoint detection.
Apache License 2.0
12.38k stars 2.84k forks source link

RT-DETR转ONNX后进行推理报错? #8553

Open expection1985 opened 10 months ago

expection1985 commented 10 months ago

问题确认 Search before asking

请提出你的问题 Please ask your question

下载这个模型rtdetr_r50vd_6x_coco.pdparams,按照说明文档转成ONNX也很顺利,但是推理的时候报错: Non-zero status code returned while running Tile node. Name:'p2o.Tile.3' Status Message: the tensor to be tiled using Tile OP must be atleast 1 dimensional onnxruntime.capi.onnxruntime_pybind11_state.InvalidArgument: [ONNXRuntimeError] : 2 : INVALID_ARGUMENT : Non-zero status code returned while running Tile node. Name:'p2o.Tile.3' Status Message: the tensor to be tiled using Tile OP must be atleast 1 dimensional

He-ningbo commented 8 months ago

我也遇到了同样的问题

ml-inory commented 6 months ago

我也遇到了同样的问题

Mrgorlay commented 5 months ago

我遇到了,有咩有解决方案呀

ml-inory commented 5 months ago

按照 https://zhuanlan.zhihu.com/p/623794029 这篇文章的方法可以导出推理成功的onnx模型

zhiboniu commented 4 months ago

可以用官方模型走一下流程对比看有没有问题

liang-stu commented 3 months ago

建议模型导出去除后处理部分,推理输出后再进行后处理。 python tools/export_model.py -c configs/rtdetr/rtdetr_r50vd_6x_coco.yml -o weights=https://bj.bcebos.com/v1/paddledet/models/rtdetr_r50vd_6x_coco.pdparams trt=True --output_dir=output_inference exclude_post_process=True 去除模型后处理部分后输出共两部分:

  1. 300个框的类别预测分数,维度为:[300, num_class]。
  2. 300个框的位置,维度为:[300, 4],其中4分别为预测框中心点坐标和预测框宽高。 后处理需执行操作:
  3. 预测类别分数,需进行SoftMax操作计算概率,筛选有效预测。
  4. 预测框的中心点坐标和宽高均为相对于输入图像的相对值,需乘原始尺寸反算。
zhangshengsheng commented 3 weeks ago

我也遇到了同样的问题