tract
tract copied to clipboard
Fix keras example
The keras example https://github.com/sonos/tract/tree/main/examples/keras-tract-tf2 is broken, I had to remove it from CI.
The no-ci.sh should run on a linux. I renamed it so it is not found by the CI. Some upgrades of underlying dependencies (keras ? tf2 ? onnxmltools ?) have broken it.
Traceback (most recent call last):
File "/home/kali/dev/sonos/tract/examples/keras-tract-tf2/example.py", line 25, in <module>
onnx_model = onnxmltools.convert_keras(model)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/kali/dev/sonos/tract/examples/keras-tract-tf2/venv/lib/python3.11/site-packages/onnxmltools/convert/main.py", line 129, in convert_keras
model_proto, external_tensor_storage = tf2onnx.convert.from_keras(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/kali/dev/sonos/tract/examples/keras-tract-tf2/venv/lib/python3.11/site-packages/tf2onnx/convert.py", line 442, in from_keras
old_out_names = _rename_duplicate_keras_model_names(model)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/kali/dev/sonos/tract/examples/keras-tract-tf2/venv/lib/python3.11/site-packages/tf2onnx/convert.py", line 331, in _rename_duplicate_keras_model_names
if model.output_names and len(set(model.output_names)) != len(model.output_names):
^^^^^^^^^^^^^^^^^^
AttributeError: 'Sequential' object has no attribute 'output_names'. Did you mean: 'output_shape'?
I need help :)