wenet-e2e / wenet

Production First and Production Ready End-to-End Speech Recognition Toolkit
https://wenet-e2e.github.io/wenet/
Apache License 2.0
4.16k stars 1.08k forks source link

在使用jit导出训练好的RNN-T模型时,报错Unknown type name 'dict' #2369

Closed DaobinZhu closed 5 months ago

DaobinZhu commented 8 months ago

命令为: python ./wenet/bin/export_jit.py --config /home/lsj/zdb/biye/wenet/examples/aishell/rnnt/exp/baseline/train.yaml --checkpoint /home/lsj/zdb/biye/wenet/examples/aishell/rnnt/exp/baseline/avg_4.pt --output_file /home/lsj/zdb/biye/wenet/examples/aishell/rnnt/exp/baseline/final.zip --output_quant_file /home/lsj/zdb/biye/wenet/examples/aishell/rnnt/exp/baseline/final_quant.zip

报错结果为: /home/lsj/.conda/envs/rnnt/lib/python3.8/site-packages/torch/jit/_check.py:178: UserWarning: The TorchScript type system doesn't support instance-level annotations on empty non-base types in __init__. Instead, either 1) use a type annotation in the class body, or 2) wrap the type in torch.jit.Attribute. warnings.warn( Traceback (most recent call last): File "./wenet/bin/export_jit.py", line 70, in main() File "./wenet/bin/export_jit.py", line 54, in main script_model = torch.jit.script(model) File "/home/lsj/.conda/envs/rnnt/lib/python3.8/site-packages/torch/jit/_script.py", line 1324, in script return torch.jit._recursive.create_script_module( File "/home/lsj/.conda/envs/rnnt/lib/python3.8/site-packages/torch/jit/_recursive.py", line 559, in create_script_module return create_script_module_impl(nn_module, concrete_type, stubs_fn) File "/home/lsj/.conda/envs/rnnt/lib/python3.8/site-packages/torch/jit/_recursive.py", line 636, in create_script_module_impl create_methods_and_properties_from_stubs( File "/home/lsj/.conda/envs/rnnt/lib/python3.8/site-packages/torch/jit/_recursive.py", line 469, in create_methods_and_properties_from_stubs concrete_type._create_methods_and_properties( RuntimeError: Unknown type name 'dict': File "/home/lsj/zdb/biye/wenet/wenet/transducer/transducer.py", line 100 def forward( self, batch: dict,


        device: torch.device,
    ) -> Dict[str, Optional[torch.Tensor]]:
Mddct commented 8 months ago

rnnt 还不支持jit导出 做推理

DaobinZhu commented 8 months ago

周佬,近期有做rnnt解码的打算吗

---原始邮件--- 发件人: "Dinghao @.> 发送时间: 2024年2月24日(周六) 上午8:07 收件人: @.>; 抄送: "Daobin @.**@.>; 主题: Re: [wenet-e2e/wenet] 在使用jit导出训练好的RNN-T模型时,报错Unknown type name 'dict' (Issue #2369)

rnnt 还不支持jit导出 做推理

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

Mddct commented 8 months ago

有的 直接是两件事情 一个是迁移w2vbert2.0 的参数, 另外一件事是把llm 的一些设计迁移过来

rnnt优先放这这两个后边

DaobinZhu commented 8 months ago

好的,谢谢

---原始邮件--- 发件人: "Dinghao @.> 发送时间: 2024年2月24日(周六) 上午8:19 收件人: @.>; 抄送: "Daobin @.**@.>; 主题: Re: [wenet-e2e/wenet] 在使用jit导出训练好的RNN-T模型时,报错Unknown type name 'dict' (Issue #2369)

有的 直接是两件事情 一个是迁移w2vbert2.0 的参数, 另外一件事是把llm 的一些设计迁移过来

rnnt优先放这这两个后边

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>