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

Fix keras example #1352

Open
kali opened this issue Mar 11, 2024 · 0 comments
Open

Fix keras example #1352

kali opened this issue Mar 11, 2024 · 0 comments

Comments

@kali
Copy link
Collaborator

kali commented Mar 11, 2024

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 :)

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

1 participant