Thanks, I think I understand now. I do think identifying a "root" type in the .proto would have been a big help and wouldn't have cost much space or bandwidth.
If I had time, I'd write a tool that would infer the root by testing for types that have matching fields, but life is short... On Sunday, December 10, 2017 at 9:35:10 AM UTC-8, Ilia Mirkin wrote: > > On Sun, Dec 10, 2017 at 11:23 AM, Jim Baldwin <[email protected] > <javascript:>> wrote: > > Perhaps it might help if I understood the output of protoc --decode_raw. > > > > Here's an example of a .caffemodel file I'm trying to inspect. Is there > a > > description of what the numbers mean in this file? > > As I said... it's a sequence of (tag, value) pairs, so... > > > > > 1: "VGG_ILSVRC_16_layers" > > Tag id 1: string value "VGG_bla" > > > 100 { > > Tag id 100: sub-message of some length (not printed here, but it's in > the encoded proto) > > > 1: "input-data" > > Tag id 1 of sub-message: "input-data" > > (I won't annotate the rest, hopefully you get the gist of it.) > > So for example, you might have a proto which is > > message foo { > string a = 1; > repeated message bar = 100; > }; > > that would lead to that sort of encoding. Nowhere is type information > encoded on the wire unless you explciitly put it there yourself. > There's no way to know which proto it is, and there can be any number > of protos that would yield a valid decoding. So you have to give it > the name of the proto it is with --decode. > > Protobuf is a structure encoding/decoding mechanism. Anything extra, > like type names or framing have to come from surrounding logic. > > -ilia > -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/protobuf. For more options, visit https://groups.google.com/d/optout.
