Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
DaobinZhu opened this issue Feb 23, 2024 · 4 comments
Closed

Comments

@DaobinZhu
Copy link
Contributor

命令为:
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,
~~~~ <--- HERE
device: torch.device,
) -> Dict[str, Optional[torch.Tensor]]:

@Mddct
Copy link
Collaborator

Mddct commented Feb 24, 2024

rnnt 还不支持jit导出 做推理

@DaobinZhu
Copy link
Contributor Author

DaobinZhu commented Feb 24, 2024 via email

@Mddct
Copy link
Collaborator

Mddct commented Feb 24, 2024

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

rnnt优先放这这两个后边

@DaobinZhu
Copy link
Contributor Author

DaobinZhu commented Feb 24, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants