You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
After updating to tensorflow 2.17 (from 2.15) we noticed that tf2onnx.convert.from_keras does not wort anymore. See examples down below.
Urgency
Not particularly urgent for us (but maybe for others?).
System information
OS Platform and Distribution (e.g., Linux Ubuntu 18.04*): 22.04
TensorFlow Version: >=2.16
Python version:3.10.12
To Reproduce
Here is a simple code snippet with keras.Sequential to reproduce the problem:
Traceback (most recent call last):
File ".../test.py", line 6, in <module>
onnx_model, _ = tf2onnx.convert.from_keras(model, opset = 18, output_path = "test.onnx")
File ".../.venv/lib/python3.10/site-packages/tf2onnx/convert.py", line 442, in from_keras
old_out_names = _rename_duplicate_keras_model_names(model)
File ".../.venv/lib/python3.10/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'?
Traceback (most recent call last):
File ".../test.py", line 8, in <module>
onnx_model, _ = tf2onnx.convert.from_keras(model, opset = 18, output_path = "test.onnx")
File ".../.venv/lib/python3.10/site-packages/tf2onnx/convert.py", line 446, in from_keras
function = _saving_utils.trace_model_call(model, input_signature)
File ".../.venv/lib/python3.10/site-packages/tensorflow/python/keras/saving/saving_utils.py", line 115, in trace_model_call
input_signature = model_input_signature(model)
File ".../.venv/lib/python3.10/site-packages/tensorflow/python/keras/saving/saving_utils.py", line 74, in model_input_signature
input_specs = model._get_save_spec(dynamic_batch=not keep_original_batch_size) # pylint: disable=protected-access
AttributeError: 'Functional' object has no attribute '_get_save_spec'. Did you mean: '_set_save_spec'?
The text was updated successfully, but these errors were encountered:
Describe the bug
After updating to tensorflow 2.17 (from 2.15) we noticed that
tf2onnx.convert.from_keras
does not wort anymore. See examples down below.Urgency
Not particularly urgent for us (but maybe for others?).
System information
To Reproduce
Here is a simple code snippet with
keras.Sequential
to reproduce the problem:It fails with the following output:
Functional style models like the following:
also fail and produce a different output:
The text was updated successfully, but these errors were encountered: