onnx / tensorflow-onnx

Convert TensorFlow, Keras, Tensorflow.js and Tflite models to ONNX
Apache License 2.0
2.32k stars 432 forks source link

error while creating onnx_node #2354

Open KTibow opened 2 months ago

KTibow commented 2 months ago

Describe the bug This error while converting a model:

2024-08-24 23:42:22,711 - INFO - Using tensorflow=2.17.0, onnx=1.16.2, tf2onnx=1.16.1/f85e88
2024-08-24 23:42:22,711 - INFO - Using opset <onnx, 17>
INFO: Created TensorFlow Lite XNNPACK delegate for CPU.
Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/usr/local/lib/python3.10/dist-packages/tf2onnx/convert.py", line 714, in <module>
    main()
  File "/usr/local/lib/python3.10/dist-packages/tf2onnx/convert.py", line 273, in main
    model_proto, _ = _convert_common(
  File "/usr/local/lib/python3.10/dist-packages/tf2onnx/convert.py", line 168, in _convert_common
    g = process_tf_graph(tf_graph, const_node_values=const_node_values,
  File "/usr/local/lib/python3.10/dist-packages/tf2onnx/tfonnx.py", line 453, in process_tf_graph
    main_g, subgraphs = graphs_from_tflite(tflite_path, input_names, output_names)
  File "/usr/local/lib/python3.10/dist-packages/tf2onnx/tflite_utils.py", line 153, in graphs_from_tflite
    parse_tflite_graph(tfl_graph, opcodes, model, prefix, tensor_shapes_from_interpreter)
  File "/usr/local/lib/python3.10/dist-packages/tf2onnx/tflite_utils.py", line 485, in parse_tflite_graph
    onnx_node = utils.make_onnx_node_with_attr(optype, input_names, output_names, name=output_names[0], **attr)
IndexError: list index out of range

Urgency

I have personal projects that would benefit from this working, not that it matters though

System information

To Reproduce

Model (inside a zip): vad.zip Command: python -m tf2onnx.convert --tflite ./vad.tflite --output ./vad.onnx --opset 17

fatcat-z commented 2 months ago

Could you please try TensorFlow 2.15 version?

KTibow commented 2 months ago

Same error