wenet-e2e / wekws

Production First and Production Ready End-to-End Keyword Spotting Toolkit
Apache License 2.0
444 stars 111 forks source link

fsmn模型无法在android上运行。 #153

Closed chenyangMl closed 6 months ago

chenyangMl commented 7 months ago

Describe the bug 提供的fsmn网络结构转换成onnx,再转换为移动端模型ort,无法在android中正常运行。Android程序一直在死循环。

To Reproduce Steps to reproduce the behavior:

  1. 将该kws_wenwen_fsmn_ctc模型转换为onnx模型 https://modelscope.cn/models/thuduj12/kws_wenwen_fsmn_ctc/summary
  2. 执行python -m onnxruntime.tools.convert_onnx_models_to_ort your-model.onnx 得到 xxx.ort模型
  3. 将xxx.ort模型替换掉原始的Android模型,并修改 feature_config = std::make_shared(40, 16000); // 40 -> 400

Expected behavior 希望支持该模型在android端的正常运行。

Screenshots

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.

duj12 commented 7 months ago

目前 基于CTCloss训练的模型还不支持runtime推理哈,可以仿照 https://github.com/wenet-e2e/wekws/blob/main/wekws/bin/stream_kws_ctc.py 这个代码进行流式推理。

chenyangMl commented 7 months ago

目前 基于CTCloss训练的模型还不支持runtime推理哈,可以仿照 https://github.com/wenet-e2e/wekws/blob/main/wekws/bin/stream_kws_ctc.py 这个代码进行流式推理。

感谢回复,请问这个能力后续有支持的计划?

duj12 commented 7 months ago

目前 基于CTCloss训练的模型还不支持runtime推理哈,可以仿照 https://github.com/wenet-e2e/wekws/blob/main/wekws/bin/stream_kws_ctc.py 这个代码进行流式推理。

感谢回复,请问这个能力后续有支持的计划?

暂时没有哈。可以参考python代码,以及wenet中的ctc-prefix-beam-search的c++实现,在wekws的runtime中实现一下。

chenyangMl commented 6 months ago

多谢,方便提供一下wenet中的ctc-prefix-beam-search的c++实现的链接?

duj12 commented 6 months ago

多谢,方便提供一下wenet中的ctc-prefix-beam-search的c++实现的链接?

https://github.com/wenet-e2e/wenet/blob/main/runtime/core/decoder/ctc_prefix_beam_search.cc

chenyangMl commented 6 months ago

多谢,方便提供一下wenet中的ctc-prefix-beam-search的c++实现的链接?

https://github.com/wenet-e2e/wenet/blob/main/runtime/core/decoder/ctc_prefix_beam_search.cc

感谢提供的支持,我按照您提供的帮助已实现该流程。可参考 https://github.com/chenyangMl/keyword-spot

yunqiushuiman commented 5 months ago

多谢,方便提供一下wenet中的ctc-prefix-beam-search的c++实现的链接?

https://github.com/wenet-e2e/wenet/blob/main/runtime/core/decoder/ctc_prefix_beam_search.cc

感谢提供的支持,我按照您提供的帮助已实现该流程。可参考 https://github.com/chenyangMl/keyword-spot

谢谢提供的链接.想请教: 请问可以根据次做"远场FSMN的你好文雅"这个模型的推理吗. https://modelscope.cn/models/iic/speech_dfsmn_kws_char_farfield_16k_nihaomiya/summary

chenyangMl commented 5 months ago

多谢,方便提供一下wenet中的ctc-prefix-beam-search的c++实现的链接?

https://github.com/wenet-e2e/wenet/blob/main/runtime/core/decoder/ctc_prefix_beam_search.cc

感谢提供的支持,我按照您提供的帮助已实现该流程。可参考 https://github.com/chenyangMl/keyword-spot

谢谢提供的链接.想请教: 请问可以根据次做"远场FSMN的你好文雅"这个模型的推理吗. https://modelscope.cn/models/iic/speech_dfsmn_kws_char_farfield_16k_nihaomiya/summary

不支持,需根据应用场景去修改。

yunqiushuiman commented 5 months ago

多谢,方便提供一下wenet中的ctc-prefix-beam-search的c++实现的链接?

https://github.com/wenet-e2e/wenet/blob/main/runtime/core/decoder/ctc_prefix_beam_search.cc

感谢提供的支持,我按照您提供的帮助已实现该流程。可参考 https://github.com/chenyangMl/keyword-spot

谢谢提供的链接.想请教: 请问可以根据次做"远场FSMN的你好文雅"这个模型的推理吗. https://modelscope.cn/models/iic/speech_dfsmn_kws_char_farfield_16k_nihaomiya/summary

不支持,需根据应用场景去修改。

谢谢您的答复,请问使用pth的模型和用ort的模型有什么区别吗. 是速度比较快 还是可以用的平台多呢

chenyangMl commented 5 months ago

pth是pytorch模型,通常使用torch推理,常见python。 ort就是onnx模型,可以在各类平台,包括端测推理。 速度上理论跟使用的硬件和推理框架有关,根据个人需求选择即可。

lin-xiaosheng commented 3 months ago

多谢,方便提供一下wenet中的ctc-prefix-beam-search的c++实现的链接?

https://github.com/wenet-e2e/wenet/blob/main/runtime/core/decoder/ctc_prefix_beam_search.cc

感谢提供的支持,我按照您提供的帮助已实现该流程。可参考 https://github.com/chenyangMl/keyword-spot

请问一下依据该流程获得的ort模型是否可以在本项目的android demo中运行?