-
Notifications
You must be signed in to change notification settings - Fork 370
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
demo_onnx.py运行报错 #175
Comments
我用最新的master安装测试没问题(昨天直接用官网的pip install funasr_onnx也ok) |
我补充了详细的环境信息。我目前装的FunASR 1.2.0似乎已经是最新的,报错问题仍然存在 |
onnx 1.17.0
torch 2.4.0
funasr 1.2.1 demo_onnx.py运行正常,可以导出模型 |
你测试的是funasr onnx,所以需要更新funasr_onnx版本。我这边最新的funasr_onnx版本是0.4.1 |
从源码安装最新的funasr 1.2.1后报错消失,非常感谢 |
Notice: In order to resolve issues more efficiently, please raise issue following the template.
(注意:为了更加高效率解决您遇到的问题,请按照模板提问,补充细节)
🐛 Bug
运行demo_onnx.py报错
demo_onnx.py:
报错信息:
Traceback (most recent call last):
File "/workspace/data/wcy/code/SenseVoice/demo_onnx.py", line 13, in
model = SenseVoiceSmall(model_dir, batch_size=1, quantize=True)
File "/root/miniforge3/envs/FunAudioLLM/lib/python3.10/site-packages/funasr_onnx/sensevoice_bin.py", line 71, in init
model_dir = model.export(type="onnx", quantize=quantize, **kwargs)
File "/root/miniforge3/envs/FunAudioLLM/lib/python3.10/site-packages/funasr/auto/auto_model.py", line 664, in export
export_dir = export_utils.export(model=model, data_in=data_list, **kwargs)
File "/root/miniforge3/envs/FunAudioLLM/lib/python3.10/site-packages/funasr/utils/export_utils.py", line 24, in export
_onnx(
File "/root/miniforge3/envs/FunAudioLLM/lib/python3.10/site-packages/funasr/utils/export_utils.py", line 80, in _onnx
torch.onnx.export(
File "/root/miniforge3/envs/FunAudioLLM/lib/python3.10/site-packages/torch/onnx/utils.py", line 516, in export
_export(
File "/root/miniforge3/envs/FunAudioLLM/lib/python3.10/site-packages/torch/onnx/utils.py", line 1612, in _export
graph, params_dict, torch_out = _model_to_graph(
File "/root/miniforge3/envs/FunAudioLLM/lib/python3.10/site-packages/torch/onnx/utils.py", line 1134, in _model_to_graph
graph, params, torch_out, module = _create_jit_graph(model, args)
File "/root/miniforge3/envs/FunAudioLLM/lib/python3.10/site-packages/torch/onnx/utils.py", line 1010, in _create_jit_graph
graph, torch_out = _trace_and_get_graph_from_model(model, args)
File "/root/miniforge3/envs/FunAudioLLM/lib/python3.10/site-packages/torch/onnx/utils.py", line 914, in _trace_and_get_graph_from_model
trace_graph, torch_out, inputs_states = torch.jit._get_trace_graph(
File "/root/miniforge3/envs/FunAudioLLM/lib/python3.10/site-packages/torch/jit/_trace.py", line 1310, in _get_trace_graph
outs = ONNXTracedModule(
File "/root/miniforge3/envs/FunAudioLLM/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1532, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/root/miniforge3/envs/FunAudioLLM/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1541, in _call_impl
return forward_call(*args, **kwargs)
File "/root/miniforge3/envs/FunAudioLLM/lib/python3.10/site-packages/torch/jit/_trace.py", line 138, in forward
graph, out = torch._C._create_graph_by_tracing(
File "/root/miniforge3/envs/FunAudioLLM/lib/python3.10/site-packages/torch/jit/_trace.py", line 129, in wrapper
outs.append(self.inner(*trace_inputs))
File "/root/miniforge3/envs/FunAudioLLM/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1532, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/root/miniforge3/envs/FunAudioLLM/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1541, in _call_impl
return forward_call(*args, **kwargs)
File "/root/miniforge3/envs/FunAudioLLM/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1522, in _slow_forward
result = self.forward(*input, **kwargs)
TypeError: export_forward() missing 2 required positional arguments: 'language' and 'textnorm'
To Reproduce
Steps to reproduce the behavior (always include the command you ran):
Code sample
Expected behavior
Environment
pip
, source): pip install -r requirements + pip3 install -U funasr funasr-onnxAdditional context
The text was updated successfully, but these errors were encountered: