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

ONNX: textual syntax support #883

Closed
AlexHJH opened this issue Feb 27, 2022 · 7 comments
Closed

ONNX: textual syntax support #883

AlexHJH opened this issue Feb 27, 2022 · 7 comments
Labels

Comments

@AlexHJH
Copy link

AlexHJH commented Feb 27, 2022

noticed that .onnxtxt suffix has bin registered in the recent commit, will it be completely supported in the future?

network file like this

@lutzroeder
Copy link
Owner

The .pbtxt format is already supported. The example posted is not a valid Text Protocol Buffer for ONNX though.

import onnx
model = onnx.load('example.onnx')
file = open('example.pbtxt', 'w')
text = str(model);
file.write(text)
file.close()

@AlexHJH
Copy link
Author

AlexHJH commented Feb 27, 2022

onnx has a new feature
(https://github.com/onnx/onnx/blob/main/docs/Syntax.md)
The syntax enables a compact and readable representation of ONNX models,like prototxt in caffe

@AlexHJH
Copy link
Author

AlexHJH commented Feb 27, 2022

@lutzroeder so i think it is possible to describe the onnx network in a textual way,and visualize it

@lutzroeder
Copy link
Owner

lutzroeder commented Feb 27, 2022

@AlexHJH can you share a few more complex example files?

.onnxtxt should not be used for such files since it is already being used for ONNX files in .pbtxt format.

@lutzroeder lutzroeder marked this as a duplicate of #884 Feb 27, 2022
@lutzroeder lutzroeder changed the title textual network visualization support for onnx(.onnxtxt ) ONNX: textual syntax support Feb 27, 2022
@gramalingam
Copy link

@AlexHJH : please note that the syntax you describe is an experimental feature of ONNX (as mentioned in the documentation). You can use the parser documented there (in C++ or python) to create a standard .onnx protobuf file which can be consumed by Netron or any other tool. It is not meant to be an interchange standard at this point, just a tool to help users easily create onnx protobuf files.

@AlexHJH
Copy link
Author

AlexHJH commented Mar 2, 2022

i think it a very good idea to describe the model in a textual syntax, but few people know it now. in the past, i wanted to modify onnx model but hvae to go back to the code and reorganize them, maybe just a little change. but now i can modify it on the text directly after i convert it to text representation, i tried and it really work @gramalingam

@lutzroeder
Copy link
Owner

Duplicate of #884

Repository owner deleted a comment from lix19937 Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants