modelscope / FunASR

A Fundamental End-to-End Speech Recognition Toolkit and Open Source SOTA Pretrained Models, Supporting Speech Recognition, Voice Activity Detection, Text Post-processing etc.
https://www.funasr.com
Other
6.45k stars 687 forks source link

Paraformer推理output[1].GetTensorMutableData<int64_t>()有时候是随机值 #581

Closed hhxdestiny closed 2 weeks ago

hhxdestiny commented 1 year ago

请教一个奇葩的问题,我写了一个ort推理paraformer的过程(根据自己的需求简化了一下funasr/runtime/onnxruntime,但是forword这里几乎是一致的),然后从Ort::Session::Run的output Tensor中获取logits时(output[0].GetTensorMutableData())是正常的,但是获取token_num时(output[1].GetTensorMutableData()),有时候正常,有时候会是一个非常大的不固定的数据(比如7306086966494233117),这个过程在同一个音频文件上也不一定必现,在token_num不正常时output[0].GetTensorTypeAndShapeInfo().GetShape()[1]是正常的,我使用output[0].GetTensorTypeAndShapeInfo().GetShape()[1]作为输出的长度也是能够工作的,但是不明白output[1].GetTensorMutableData()和output[0].GetTensorTypeAndShapeInfo().GetShape()[1]不一致的缘由。。。

lyblsgo commented 2 weeks ago

Let's close this issue for now. If needed, reopen it.