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

[Relay][Frontend][ONNX] Raise error when user provides an input not in the onnx graph. #7699

Merged
merged 1 commit into from
Mar 19, 2021

Conversation

jwfromm
Copy link
Contributor

@jwfromm jwfromm commented Mar 18, 2021

There was recently some discussion about how the onnx importer should handle being passed a shape dict that contains inputs not found in the onnx graph. Currently, the importer will just ignore these inputs. However, this could lead to user confusion if they make a simple typo and are expecting different behavior than what they get. This PR adds checking for inputs in the shape dict that arent part of the graph and informs the user if it finds any. Overall, this should provide a more clear experience.

I added a test to confirm the behavior works as described and found that one of our onnx tests (test_pad) was actually providing gratuitous input information.

Copy link
Contributor

@mbrookhart mbrookhart left a comment

Choose a reason for hiding this comment

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

LGTM. Thank you!

@masahi masahi merged commit 35b43e1 into apache:main Mar 19, 2021
@masahi
Copy link
Member

masahi commented Mar 19, 2021

Thanks @jwfromm @mbrookhart

AndrewZhaoLuo pushed a commit to AndrewZhaoLuo/tvm that referenced this pull request Mar 22, 2021
* main:
  [AutoScheduler] Add function name in message (apache#7703)
  [Vulkan] Workaround for zero size allocation (apache#7691)
  Change behavior of onnx importer to throw when user provides an input no in the graph. (apache#7699)
  Free TensorRT engine and context (apache#7702)
  [TFLite] Cast operator adapted for MLIR-based convertor (apache#7639)
  [CPP_RPC] allow user supplied work dir (apache#7670)
  Default value for graph_runtime Init lookup_linked_param_func (apache#7676)
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request May 6, 2021
trevor-m pushed a commit to neo-ai/tvm that referenced this pull request May 11, 2021
@jwfromm jwfromm deleted the onnx_input_error branch April 12, 2023 15:55
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.

3 participants