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

A tool to sanitize ONNX models #4476

Open
gramalingam opened this issue Aug 29, 2022 · 2 comments
Open

A tool to sanitize ONNX models #4476

gramalingam opened this issue Aug 29, 2022 · 2 comments

Comments

@gramalingam
Copy link
Contributor

ONNX models used in practice often violate some of the contraints specified by the ONNX standard. Examples include the following:

  • The standard specifies that identifiers must be valid C identifiers, but use of numbers such as "23" as tensor-names is common.
  • ONNX has a more complex shape-specification that uses symbolic identifiers to denote unknown dimensions, but occasionally models use a number such as -1 to indicate an unknown dimension (common in some other frameworks).

A sanitizer tool that fixes such violations (where a simple fix exists) would be useful. It would take in an input ONNX model and produce a sanitized ONNX model as output with such obvious violations repaired.

@diyessi
Copy link
Contributor

diyessi commented Aug 29, 2022

I have seen exported models where providing values for the exported symbols do not work because constants are used in some places and the symbol in others. We let shapes be provided for inputs and warn/err as appropriate if shape inference finds inconsistencies.

@justinchuby
Copy link
Contributor

justinchuby commented Jul 31, 2023

#5433 #5348

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants