ONNX's ModelProto (org.bytedeco.connx.ModelProto) appears to have no way to serialize to a text (human-readable) format.
I tried using TextFormat from Java protobufs but it doesn't work with a ModelProto.
Is there any other way to get a text format of a ModelProto?
@EmergentOrder Any ideas?
You can serialize it to a string with model.SerializeAsString(), although it's not exactly readable.
Once you have the bytes, as per the example, try this:
com.google.protobuf.Any.parseFrom(bytes).toString()
Field names are lost, but should still be good enough to get an idea of the model structure.
BTW, we should probably bundle the Java interface generated by Protocol Buffers as well.
Thanks @EmergentOrder, that's clever and an improvement on SerializeAsString().