使用paddle inference推理ppyolov2 输入和输出的问题
在使用inference推理的时候,打印出input_tensor的name是['im_shape','image','scale_factor'],请问这三个tensor的维度该如何设定以及数据该如何进行输入。另外,使用tensorrt加速,输出的tensor名称是[‘nearest_interp_v2_1.tmp_0','concat_4.tmp_0'],这两个tensor又分别是什么意义?
您好,我们已经收到了您的问题,会安排技术人员尽快解答您的问题,请耐心等待。请您再次检查是否提供了清晰的问题描述、复现代码、环境&版本、报错信息等。同时,您也可以通过查看官网API文档、常见问题、历史Issue、AI社区来寻求解答。祝您生活愉快~
Hi! We've received your issue and please be patient to get responded. We will arrange technicians to answer your questions as soon as possible. Please make sure that you have posted enough message to demo your request. You may also check out the API,FAQ,Github Issue and AI community to get the answer.Have a nice day!
tensor维度的设置可以用netron打开以后看到模型训练时的维度,数据的输入的话可以参考Inference的文档https://paddleinference.paddlepaddle.org.cn/quick_start/cpp_demo.html
输出tensor的名称也是在训练时框架决定的,只能表示是nearest_interp_v2和concat这两个op的输出,具体意义得看模型是怎么设计的了
input_tensor:
- image代表图像,维度为[b, 3, h, w]
- im_shape为图像在resize之后的大小,维度为[b, 2],表示每一个图像resize之后的[h, w]
- scale_factor为resize的ratio,维度为[b, 2],表示每一个图像resize的[scale_y, scale_x]
输入tensor可以参考PaddleDetection的预处理代码进行设置:https://github.com/PaddlePaddle/PaddleDetection/blob/release/2.1/deploy/python/preprocess.py 输出tensor由于经过了fuse,其名字不能表达其含义,
- output_names[0]为bbox输出,维度为[N, 6],表示[label, confidence, xmin, ymin, xmax, ymax],该batch中每一个图像检测到的框concat到了一起
- output_names[1]为rois_num,维度为[b],表示该batch中每一个图像检测到的框的数量
@wangxinxin08
我想问下这个模型里面im_shape 一般维度都是[?,2] ,这种[?,3]的情况该怎么传入参数 ?
还有就是 im_info 的参数是和 scale_factor 一样的么? 如果是一样,[?,3]的情况该怎么传入参数 ?