freewym / espresso

Espresso: A Fast End-to-End Neural Speech Recognition Toolkit
Other
942 stars 116 forks source link

ONNX exportation of speech_lstm based model #53

Closed krishnanNuance closed 3 years ago

krishnanNuance commented 3 years ago

❓ Questions and Help

Not able onnx export speech_lstm based model.

What is your question?

Is the speech_lstm model expected to be onnx exportable? Currently get the error as shown below:

Code

        torch.onnx.export(model, dummy_input,  
                          f.name+".onnx", verbose=True, opset_version=12,
                          input_names=input_names, output_names=output_names)

Traceback (most recent call last): File "export_77/../test_scripts/test_export_asr.py", line 67, in _test_save_and_onnx_model input_names=input_names, output_names=output_names) File "export_77/.env/export/lib/python3.6/site-packages/torch/onnx/init.py", line 230, in export custom_opsets, enable_onnx_checker, use_external_data_format) File "export_77/.env/export/lib/python3.6/site-packages/torch/onnx/utils.py", line 91, in export use_external_data_format=use_external_data_format) File "export_77/.env/export/lib/python3.6/site-packages/torch/onnx/utils.py", line 639, in _export dynamic_axes=dynamic_axes) File "export_77/.env/export/lib/python3.6/site-packages/torch/onnx/utils.py", line 421, in _model_to_graph dynamic_axes=dynamic_axes, input_names=input_names) File "export_77/.env/export/lib/python3.6/site-packages/torch/onnx/utils.py", line 203, in _optimize_graph graph = torch._C._jit_pass_onnx(graph, operator_export_type) File "export_77/.env/export/lib/python3.6/site-packages/torch/onnx/init.py", line 263, in _run_symbolic_function return utils._run_symbolic_function(*args, kwargs) File "export_77/.env/export/lib/python3.6/site-packages/torch/onnx/utils.py", line 934, in _run_symbolic_function return symbolic_fn(g, *inputs, *attrs) File "export_77/.env/export/lib/python3.6/site-packages/torch/onnx/symbolic_helper.py", line 133, in wrapper return fn(g, args, kwargs) File "export_77/.env/export/lib/python3.6/site-packages/torch/onnx/symbolic_opset9.py", line 441, in transpose axes[dim0], axes[dim1] = axes[dim1], axes[dim0] IndexError: list index out of range

What's your environment?

freewym commented 3 years ago

I didn't test speech_lstm with onnx. Sorry I haven't made an effort on this.