Questions tagged [protocol-buffers]

For questions about Google's protocol buffers

Protocol buffers are Google's language-neutral, platform-neutral, extensible mechanism for serializing structured data – think XML, but smaller, faster, and simpler. You define how you want your data to be structured once, then you can use special generated source code to easily write and read your structured data to and from a variety of data streams and using a variety of languages.

https://developers.google.com/protocol-buffers

7638 questions
31
votes
2 answers

Loading SavedModel is a lot slower than loading a tf.train.Saver checkpoint

I changed from tf.train.Saver to the SavedModel format which surprisingly means loading my model from disk is a lot slower (instead of a couple of seconds it takes minutes). Why is this and what can I do to load the model faster? I used to do…
Carl Thomé
  • 2,703
  • 3
  • 19
  • 41
31
votes
2 answers

Examining a protobuf message - how to get field values by name?

I seem unable to find a way to verify the value of a field inside a protobuf message without explicitly invoking its getter. I see examples around that make usage of Descriptors.FieldDescriptor instances to reach inside the message map, but they are…
Marco Faustinelli
  • 3,734
  • 5
  • 30
  • 49
31
votes
6 answers

Is there a standard mapping between JSON and Protocol Buffers?

From a comment on the announcement blog post: Regarding JSON: JSON is structured similarly to Protocol Buffers, but protocol buffer binary format is still smaller and faster to encode. JSON makes a great text encoding for protocol…
Daniel Earwicker
  • 114,894
  • 38
  • 205
  • 284
31
votes
6 answers

Zig Zag Decoding

In the google protocol buffers encoding overview, they introduce something called "Zig Zag Encoding", this takes signed numbers, which have a small magnitude, and creates a series of unsigned numbers which have a small magnitude. For example Encoded…
31
votes
1 answer

Is there one-byte type in protobuf?

I can't find if there is possible to have char / byte type in proto. I can see various types here: https://developers.google.com/protocol-buffers/docs/proto https://developers.google.com/protocol-buffers/docs/encoding but I can't find byte type…
cnd
  • 32,616
  • 62
  • 183
  • 313
30
votes
5 answers

raw decoder for protobufs format

I'd like to find a way to convert a binary protobuf message into a human readable description of the contained data, without using the .proto files. The background is that I have a .proto message that it being rejected by the parser on Android, but…
JosephH
  • 37,173
  • 19
  • 130
  • 154
30
votes
3 answers

How to generate OpenAPI 3 documentation from protobuf files

I have an API generated from protobuf, and I would like to generate documentation conforming to the OpenAPI 3 spec. I've looked at a number of utilities but I haven't found a combination that works. Does anyone know of a path from protobuf to…
KHilse
  • 301
  • 1
  • 3
  • 4
30
votes
2 answers

Wheel files : What is the meaning of "none-any" in protobuf-3.4.0-py2.py3-none-any.whl

I used pip to get .whl file for numpy pip wheel --wheel-dir=./ numpy and I have got numpy-1.13.3-cp27-cp27mu-linux_armv7l.whl because I am using ARM platform, but when run pip for protobuf pip wheel --wheel-dir=./ protobuf I got…
M Y
  • 464
  • 4
  • 7
  • 19
30
votes
3 answers

How to dynamically build a new protobuf from a set of already defined descriptors?

At my server, we receive Self Described Messages (as defined here... which btw wasn't all that easy as there aren't any 'good' examples of this in c++). At this point I am having no issue creating messages from these self-described ones. I can take…
g19fanatic
  • 10,567
  • 6
  • 33
  • 63
29
votes
3 answers

Undefined reference to google::protobuf::internal::empty_string_[abi:cxx11]

I'm trying to build simple test application with Protocol Buffers 2.6.1 and GNU GCC 5.1.0 (on Ubuntu 14.10) and I get following errors: /home/ragnar/cpp-tools/gcc-linux/bin/g++ -c "/home/ragnar/cpp-projects/gprotobuf_test/main.cpp" -g -O0 -Wall …
Ragnar
  • 1,387
  • 4
  • 20
  • 29
29
votes
1 answer

solutions to resolve enum field naming restriction in Google protobuf due to C++

As you might know, when you define enums in Google protobuf either with global scope or in same message, you can't define enum field name to be same if enums are sibling. Even if you are going to generate Java code with proto file, protoc complains…
wonhee
  • 1,581
  • 1
  • 14
  • 24
28
votes
1 answer

Can I define a constant string in protobuf?

I use protobuf's enums to share values between a C++ app and a Java app. This way, the same (int) values are shared between languages and the values are available at compile time. Can I do something similar with a string by somehow defining it in…
ytoledano
  • 3,003
  • 2
  • 24
  • 39
28
votes
1 answer

simple protobuf compilation with gradle

If you're looking for sample gradle protobuf project look here. I'm having hard time with gradle and protobuf, i want to create a simple gradle project that will take any proto files from default src/main/proto, src/test/proto and compile them to…
vach
  • 10,571
  • 12
  • 68
  • 106
28
votes
3 answers

Parsing Protocol-Buffers without knowing the .proto

I know that protocol-buffers are a serialized format that requires a message format in the .proto in order to read back properly. But I have a file that I do not know the proper message format for because it isn't published. What I am trying to do…
tjac
  • 797
  • 2
  • 9
  • 16
27
votes
3 answers

Protocol Buffer: Enum issue

I have the following .proto file : enum Enum1{ X=0; Y=1; } message SomeClass{ required Enum1 enum1=1; required Enum2 enum2=2; } enum Enum2{ X=0; Z=1; } When I try to comile it using protoc , I get the following…
Echo
  • 2,959
  • 15
  • 52
  • 65