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

[Coreml] Fix Coreml Input Shape Handling #8562

Merged
merged 3 commits into from
Jul 29, 2021

Conversation

AndrewZhaoLuo
Copy link
Contributor

@AndrewZhaoLuo AndrewZhaoLuo commented Jul 26, 2021

The input shape may not be a python list (which is what the ffi knows how to handle) but rather a rather complicated protobuf object. The solution is to just convert it to a python list.

Before:
TypeError: Don't know how to handle type <class 'google.protobuf.pyext._message.RepeatedScalarContainer'>

After:
Works! Now we just have an issue with unsupported ops.

Before:
Running this script: https://github.com/AndrewZhaoLuo/TVM-Sandbox/blob/bf3df0ee1dcc382a68cb551bc73826dff94b73b9/coreml_debug/coreml-test.py#L1

Fails with
TypeError: Don't know how to handle type <class 'google.protobuf.pyext._message.RepeatedScalarContainer'>

Now:
It fails with an unsupported operator which the user can now add.

@AndrewZhaoLuo AndrewZhaoLuo changed the title Fix Coreml Input Shape Handling [Draft] Fix Coreml Input Shape Handling Jul 26, 2021
@AndrewZhaoLuo AndrewZhaoLuo changed the title [Draft] Fix Coreml Input Shape Handling Fix Coreml Input Shape Handling Jul 26, 2021
@AndrewZhaoLuo AndrewZhaoLuo changed the title Fix Coreml Input Shape Handling [Coreml] Fix Coreml Input Shape Handling Jul 26, 2021
Copy link
Contributor

@jwfromm jwfromm left a comment

Choose a reason for hiding this comment

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

LGTM, thanks Andrew!

@jcf94 jcf94 merged commit 92f9558 into apache:main Jul 29, 2021
ylc pushed a commit to ylc/tvm that referenced this pull request Sep 29, 2021
* convert ot python list like expected

* test example

* jostle ci

Co-authored-by: Andrew Zhao Luo <andrewzhaoluo@system76-pc.localdomain>
ylc pushed a commit to ylc/tvm that referenced this pull request Jan 13, 2022
* convert ot python list like expected

* test example

* jostle ci

Co-authored-by: Andrew Zhao Luo <andrewzhaoluo@system76-pc.localdomain>
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.

4 participants