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

Create the onnxtxt serialization format #5524

Merged
merged 11 commits into from
Aug 25, 2023

Conversation

justinchuby
Copy link
Contributor

@justinchuby justinchuby commented Aug 24, 2023

Add support for serializing to and deserializing from the ONNX textual representation, and register it under the onnxtxt file extension and format.

Users can now save a model to the textual representation with onnx.save_model(model, "model.onnxtxt")

Note that the textual format has known limitations, including (1) it doesn’t serialize tensor protos or initializers and (2) bugs like #5102. We will call this out in a documentation in a separate PR.

justinchuby and others added 6 commits August 23, 2023 21:05
Signed-off-by: Justin Chu <justinchu@microsoft.com>
Signed-off-by: Justin Chu <justinchu@microsoft.com>
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Signed-off-by: Justin Chu <justinchu@microsoft.com>
@justinchuby justinchuby requested a review from a team as a code owner August 24, 2023 18:04
@justinchuby justinchuby added this to the 1.15 milestone Aug 24, 2023
onnx/serialization.py Outdated Show resolved Hide resolved
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

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

lintrunner found more than 10 potential problems in the proposed changes. Check the Files changed tab for more details.

onnx/serialization.py Fixed Show fixed Hide fixed
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
onnx/serialization.py Outdated Show resolved Hide resolved
onnx/serialization.py Outdated Show resolved Hide resolved
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
onnx/serialization.py Fixed Show fixed Hide fixed
onnx/serialization.py Fixed Show fixed Hide fixed
onnx/serialization.py Fixed Show fixed Hide fixed
onnx/serialization.py Fixed Show fixed Hide fixed
Signed-off-by: Justin Chu <justinchu@microsoft.com>
onnx/test/basic_test.py Outdated Show resolved Hide resolved
onnx/serialization.py Show resolved Hide resolved
onnx/serialization.py Show resolved Hide resolved
onnx/test/basic_test.py Outdated Show resolved Hide resolved
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
@justinchuby justinchuby added this pull request to the merge queue Aug 25, 2023
@justinchuby
Copy link
Contributor Author

I am going to merge this first and work on a page to document limitations

Merged via the queue into onnx:main with commit c77397e Aug 25, 2023
33 checks passed
@justinchuby justinchuby deleted the justinchu/textual-ser branch August 25, 2023 22:44
corwinjoy pushed a commit to corwinjoy/onnx that referenced this pull request Sep 5, 2023
Add support for serializing to and deserializing from the ONNX textual
representation, and register it under the `onnxtxt` file extension and
format.

Users can now save a model to the textual representation with
`onnx.save_model(model, "model.onnxtxt")`

Note that the textual format has known limitations, including (1) it
doesn’t serialize tensor protos or initializers and (2) bugs like onnx#5102.
We will call this out in a documentation in a separate PR.

---------

Signed-off-by: Justin Chu <justinchu@microsoft.com>
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Signed-off-by: Corwin Joy <corwinjoy@gmail.com>
corwinjoy pushed a commit to corwinjoy/onnx that referenced this pull request Sep 5, 2023
Add support for serializing to and deserializing from the ONNX textual
representation, and register it under the `onnxtxt` file extension and
format.

Users can now save a model to the textual representation with
`onnx.save_model(model, "model.onnxtxt")`

Note that the textual format has known limitations, including (1) it
doesn’t serialize tensor protos or initializers and (2) bugs like onnx#5102.
We will call this out in a documentation in a separate PR.

---------

Signed-off-by: Justin Chu <justinchu@microsoft.com>
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Signed-off-by: Corwin Joy <corwinjoy@gmail.com>
corwinjoy pushed a commit to corwinjoy/onnx that referenced this pull request Sep 5, 2023
Add support for serializing to and deserializing from the ONNX textual
representation, and register it under the `onnxtxt` file extension and
format.

Users can now save a model to the textual representation with
`onnx.save_model(model, "model.onnxtxt")`

Note that the textual format has known limitations, including (1) it
doesn’t serialize tensor protos or initializers and (2) bugs like onnx#5102.
We will call this out in a documentation in a separate PR.

---------

Signed-off-by: Justin Chu <justinchu@microsoft.com>
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Signed-off-by: Corwin Joy <corwinjoy@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants