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.46k stars 688 forks source link

speech_seaco_paraformer_large_asr_nat-zh-cn-16k-common-vocab8404-pytorch 用onnx推理时候报错 #1504

Closed acetotot closed 4 months ago

acetotot commented 7 months ago

Code

model_dir = "iic/speech_seaco_paraformer_large_asr_nat-zh-cn-16k-common-vocab8404-pytorch/" model = Paraformer(model_dir, batch_size=1, quantize=True) result = model("norm.wav")

What's your environment?

报错: return self.session.run(self.get_output_names(), input_dict) "Required inputs (['bias_embed']) are missing from input feed (['speech', 'speech_lengths'])."

LauraGPT commented 7 months ago

Update the code and try it again.

TengLi931128 commented 6 months ago

+1, same error.

显示 ‘input wav is silence or noise’,但我在代码定位了下,报错的信息还是"Required inputs (['bias_embed']) are missing from input feed (['speech', 'speech_lengths'])."

funasr 1.0.24 funasr-onnx 0.3.1

R1ckShi commented 4 months ago

可以在现在最新的代码中通过如下的方法导出:

from funasr import AutoModel

model = AutoModel(
    model="iic/speech_seaco_paraformer_large_asr_nat-zh-cn-16k-common-vocab8404-pytorch",
)

res = model.export(type="onnx", quantize=False)
print(res)