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 subgraph bug #260

Merged
merged 16 commits into from
Aug 21, 2023
Merged

fix subgraph bug #260

merged 16 commits into from
Aug 21, 2023

Conversation

xiaowuhu
Copy link
Collaborator

@xiaowuhu xiaowuhu commented Jul 13, 2023

  • When convert onnx model from fp32 to fp16, the previous process didn't distinguish global graph(model.graph) with sub-graph such as the elseGraph and thenGraph in If op's attribute, so the new Cast op was added into global graph, but it should be insinde the sub-graph.
  • After added Cast op, the order of all the ops should be re-sort, in order that the ORT can inference it correctly. Before this PR, the resort need using other tools to do, not friendly to end user.
  • add pyproject.toml, because setup.py was deprecated and cannot be used any longer since last week

@xiaowuhu xiaowuhu requested review from fatcat-z and xadupre July 13, 2023 09:23
Signed-off-by: xiaowuhu <[email protected]>
@fatcat-z
Copy link

Please fix the CI failures.

Signed-off-by: xiaowuhu <[email protected]>
This reverts commit 2da0727.
@xiaowuhu xiaowuhu merged commit 3873b29 into master Aug 21, 2023
@@ -248,9 +248,9 @@ def find_type_conversion(source_type, target_type):
"""
Find the operator name for converting source_type into target_type
"""
if type(source_type) == type(target_type):
if isinstance(source_type, target_type):
Copy link

Choose a reason for hiding this comment

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

Convert from coreml calls this with target_type being FloatTensorType(shape=[]), which is not a type, resulting in
TypeError: isinstance() arg 2 must be a type, a tuple of types, or a union

Writing here because the old version would have worked

Python 3.10.13
onnxconverter_common.version 1.14.0
onnxmltools.version 1.12.0
onnx.version 1.15.0
coremltools.version 7.1

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.

5 participants