Skip to content

Conversation

fatcat-z
Copy link
Collaborator

@fatcat-z fatcat-z commented Jun 14, 2022

When converting a tflite model to an onnx ModelProto using from_tflite() function, if the output_names argument is not specified, it defaults to an empty list instead of None.

However, in the tf2onnx.tflite_utils.graphs_from_tflite function, if the output_names argument is not None, the output names retrieved automatically by the tf2onnx.tflite_utils.parse_tflite_graph function are overwritten, resulting in a ModelProto with no output which causes a bug.

So the function should not change None to an empty list for both input_names and output_names arguments. This PR fixes this problem. Add related tests as well.

Fix #1963

System information

Signed-off-by: Jay Zhang [email protected]

…empty list for input_names and output_names.

Signed-off-by: Jay Zhang <[email protected]>
@fatcat-z fatcat-z requested a review from hwangdeyu June 14, 2022 04:27
Copy link
Contributor

@hwangdeyu hwangdeyu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@fatcat-z fatcat-z enabled auto-merge (squash) June 15, 2022 06:17
@fatcat-z fatcat-z merged commit 89c4c5c into onnx:main Jun 15, 2022
@fatcat-z fatcat-z deleted the fix_tflite_issue branch June 15, 2022 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tflite model graph output name defaults to an empty list when using from_tflite
2 participants