FunASR icon indicating copy to clipboard operation
FunASR copied to clipboard

使用paraformer_streaming下finetune脚本微调online模型后,直接使用微调后权重文件可以输出中文,但是导出为onnx文件后输出为乱码

Open yepengxj opened this issue 1 year ago • 1 comments

Notice: In order to resolve issues more efficiently, please raise issue following the template. (注意:为了更加高效率解决您遇到的问题,请按照模板提问,补充细节)

❓ Questions and Help

What is your question?

使用paraformer_streaming下finetune脚本微调online模型后,直接使用微调后权重文件可以输出中文,但是导出为onnx文件后输出为乱码

What's your environment?

  • OS (e.g., Linux):Linux

  • FunASR Version (e.g., 1.0.0):1.0.18

  • ModelScope Version (e.g., 1.11.0):1.13.2

  • PyTorch Version (e.g., 2.0.0):2.0.1

  • How you installed funasr (pip, source): source pip install -e ./

  • Python version:

  • GPU (e.g., V100M32)P40

  • CUDA/cuDNN version (e.g., cuda11.7): 11.7

  • Any other relevant information:

  • onnx 1.16.0

  • onnxruntime 1.17.0

使用微调后权重文件输出: examples/industrial_data_pretraining/paraformer_streaming# python3 ./demo.py Notice: ffmpeg is not installed. torchaudio is used to load audio If you want to use ffmpeg backend to load audio, please install it by: sudo apt install ffmpeg # ubuntu # brew install ffmpeg # mac Notice: If you want to use the speaker diarization, please pip install hdbscan Notice: If you want to use whisper, please pip install -U openai-whisper ckpt: /root/app/examples/industrial_data_pretraining/paraformer_streaming/outputs/model.pb rtf_avg: 9.888: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:01<00:00, 1.78s/it] [{'key': 'rand_key_2yW4Acq9GFz6Y', 'text': '塔克欢迎迎家来体验达摩院推出的语音识别模型'}] rtf_avg: 0.284: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 5.82it/s] [{'key': 'rand_key_1t9EwL56nGisi', 'text': '阿'}] rtf_avg: 0.296: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 5.59it/s] [{'key': 'rand_key_WgNZq6ITZM5jt', 'text': '克'}] rtf_avg: 0.365: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 4.55it/s] [{'key': 'rand_key_gUe52RvEJgwBu', 'text': '欢迎迎'}] rtf_avg: 0.416: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 3.99it/s] [{'key': 'rand_key_NO6n9JEC3HqdZ', 'text': '家来'}] rtf_avg: 0.748: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 2.22it/s] [{'key': 'rand_key_6J6afU1zT0YQO', 'text': '体验达'}] rtf_avg: 0.308: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 5.39it/s] [{'key': 'rand_key_aNF03vpUuT3em', 'text': '摩院推'}] rtf_avg: 0.307: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 5.39it/s] [{'key': 'rand_key_6KopZ9jZICffu', 'text': '出的语'}] rtf_avg: 0.314: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 5.28it/s] [{'key': 'rand_key_4G7FgtJsThJv0', 'text': '音音别'}] rtf_avg: 0.306: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 5.42it/s] [{'key': 'rand_key_7In9ZMJLsCfMZ', 'text': '模型'}] rtf_avg: 0.855: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 6.46it/s] [{'key': 'rand_key_yuKpslm0lcNQq', 'text': ''}] 使用onnx格式输出: runtime/python/onnxruntime# python3 ./demo_paraformer_online.py [{'preds': ('咽滢螵生', ['咽', '滢', '螵', '生'])}] [{'preds': ('thanks gh窠幕糕', ['thanks', 'gh', '窠', '幕', '糕'])}] [{'preds': ('醇疾oms硌镟', ['醇', '疾', 'oms', '硌', '镟'])}] [{'preds': ('导澄生镟隐', ['导', '澄', '生', '镟', '隐'])}] [{'preds': ('篝阡谤糕摞', ['篝', '阡', '谤', '糕', '摞'])}] [{'preds': ('若说少糕军螈', ['若', '说', '少', '糕', '军', '螈'])}] [{'preds': ('佯龋足龋橙', ['佯', '龋', '足', '龋', '橙'])}] [{'preds': ('sts逃螈披蜱', ['sts', '逃', '螈', '披', '蜱'])}] [{'preds': ('楷选囹还丐', ['楷', '选', '囹', '还', '丐'])}] [{'preds': ('渤载瓿藕', ['渤', '载', '瓿', '藕'])}] 咽滢螵生thanks gh窠幕糕醇疾oms硌镟导澄生镟隐篝阡谤糕摞若说少糕军螈佯龋足龋橙sts逃螈披蜱楷选囹还丐渤载瓿藕

yepengxj avatar Apr 08 '24 05:04 yepengxj

check the log of export. The model.pt is missing.

LauraGPT avatar Apr 08 '24 12:04 LauraGPT