Is there ever a good time to use int32 instead of sint32 in Google Protocol Buffers?

I’m not familiar with Google Protocol Buffers, but my interpretation of the documentation is: use uint32 if the value cannot be negative use sint32 if the value is pretty much as likely to be negative as not (for some fuzzy definition of “as likely to be”) use int32 if the value could be negative, but … Read more

google protobuf maximum size

10MB is pushing it but you’ll probably be OK. Protobuf has a hard limit of 2GB, because many implementations use 32-bit signed arithmetic. For security reasons, many implementations (especially the Google-provided ones) impose a size limit of 64MB by default, although you can increase this limit manually if you need to. The implementation will not … Read more

Protobuf3: How to describe map of repeated string?

I had the same need, and got the same error. I do not believe this is possible. Here is the relevant BNF definitions from the language specification. https://developers.google.com/protocol-buffers/docs/reference/proto3-spec messageType = [ “.” ] { ident “.” } messageName mapField = “map” “<” keyType “,” type “>” mapName “=” fieldNumber [ “[“fieldOptions “]” ] “;” type … Read more

Correct format of protoc go_package?

For pure proto generations you can do the following protoc –go_out=paths=source_relative:./gen -I. authenticator.proto or to generate for grpc the following can be used protoc –go_out=plugins=grpc:./gen –go_opt=paths=source_relative authenticator.proto If that fails you likely have a newer version of protoc and need to use the following command instead. protoc –go-grpc_out=./gen –go-grpc_opt=paths=source_relative authenticator.proto This is just Google making … Read more

Is there an example on how to generate protobuf files holding trained TensorFlow graphs

EDIT: The freeze_graph.py script, which is part of the TensorFlow repository, now serves as a tool that generates a protocol buffer representing a “frozen” trained model, from an existing TensorFlow GraphDef and a saved checkpoint. It uses the same steps as described below, but it much easier to use. Currently the process isn’t very well … Read more

How does protocol buffer handle versioning?

Google designed protobuf to be pretty forgiving with versioning: unexpected data is either stored as “extensions” (making it round-trip safe), or silently dropped, depending on the implementation new fields are generally added as “optional”, meaning that old data can be loaded successfully however: do not renumber fields – that would break existing data you should … Read more