Questions tagged [protocol-buffers]

For questions about Google's protocol buffers

protocol-buffers
Filter by
Sorted by
Tagged with
71 votes
11 answers
35k views

Are there C++ equivalents for the Protocol Buffers delimited I/O functions in Java?

I'm trying to read / write multiple Protocol Buffers messages from files, in both C++ and Java. Google suggests writing length prefixes before the messages, but there's no way to do that by default (...
tzaman's user avatar
  • 47.4k
16 votes
3 answers
7k views

InfogainLoss layer

I wish to use a loss layer of type InfogainLoss in my model. But I am having difficulties defining it properly. Is there any tutorial/example on the usage of INFOGAIN_LOSS layer? Should the input to ...
Shai's user avatar
  • 113k
236 votes
10 answers
303k views

How to define an optional field in protobuf 3

I need to specify a message with an optional field in protobuf (proto3 syntax). In terms of proto 2 syntax, the message I want to express is something like: message Foo { required int32 bar = 1; ...
MaxP's user avatar
  • 2,824
105 votes
3 answers
96k views

What does the protobuf text format look like?

Google Protocol Buffers can not only be serialized in binary format, also be serialized as text, known as textproto. However I can't easily find examples of such text; what would it look like? ...
Vi.'s user avatar
  • 37.9k
92 votes
5 answers
97k views

Google Protocol Buffers: JavaScript Example

Is it a good choice to use Google Protocol Buffers in JavaScript or is it better to do it with JSON? Also it'd be great if someone can give me a simple example about Protocol Buffers implementation ...
nikolakoco's user avatar
  • 1,393
5 votes
1 answer
29k views

Errors when linking to protobuf 3 on MS Visual C

Encountered on Visual Studio 2013, but it's reproducible with any version. I cloned the protocol buffer library from github, ran CMake-gui on it (I left everything to default, so it's the static ...
jokoon's user avatar
  • 6,423
380 votes
4 answers
203k views

Why required and optional is removed in Protocol Buffers 3

I'm recently using gRPC with proto3, and I've noticed that required and optional has been removed in new syntax. Would anyone kindly explain why required/optional are removed in proto3? Such kind of ...
yjzhang's user avatar
  • 5,049
47 votes
6 answers
30k views

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

I am looking at Google's example on how to deploy and use a pre-trained Tensorflow graph (model) on Android. This example uses a .pb file at: https://storage.googleapis.com/download.tensorflow.org/...
Shanqing Cai's user avatar
  • 3,836
23 votes
2 answers
11k views

Retrieve large blob from Android sqlite database

I stored chunks of binary data (protobufs) in the sqlite database of an Android app without realizing that Android's Cursor can only hold a maximum of 1MB of data. I now know that I should have stored ...
ashughes's user avatar
  • 7,193
108 votes
2 answers
45k views

TensorFlow saving into/loading a graph from a file

From what I've gathered so far, there are several different ways of dumping a TensorFlow graph into a file and then loading it into another program, but I haven't been able to find clear examples/...
Technicolor's user avatar
  • 1,599
29 votes
3 answers
67k views

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/...
Ragnar's user avatar
  • 1,428
23 votes
4 answers
26k views

How to build Google's protobuf in Windows using MinGW?

I'm using Codeblocks as my IDE with MingGW. I'm trying to use google protocol buffers, but I'm having trouble building the protobuf. The readme file for protobuf says: If you are using Cygwin or ...
Alex's user avatar
  • 1,469
316 votes
15 answers
148k views

Biggest differences of Thrift vs Protocol Buffers? [closed]

What are the biggest pros and cons of Apache Thrift vs Google's Protocol Buffers?
user avatar
49 votes
14 answers
114k views

protoc-gen-go-grpc: program not found or is not executable

go version: go version go1.14 linux/amd64 go.mod module [redacted] go 1.14 require ( github.com/golang/protobuf v1.4.0-rc.2 google.golang.org/grpc v1.27.1 google.golang.org/protobuf v1....
Ayush Gupta's user avatar
  • 9,068
30 votes
5 answers
34k views

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 ...
JosephH's user avatar
  • 37.3k
26 votes
2 answers
41k views

How to link google protobuf libraries via cmake on linux?

I'm trying to make it same way I made it for boost : find_package(Boost COMPONENTS system filesystem REQUIRED) find_package(ProtocolBuffers) ...
cnd's user avatar
  • 33.2k
102 votes
11 answers
129k views

How to solve "AttributeError: module 'google.protobuf.descriptor' has no attribute '_internal_create_key"?

I encountered it while executing from object_detection.utils import label_map_util in jupyter notebook. It is actually the tensorflow object detection tutorial notebook(it comes with the tensorflow ...
Reghunaath A A's user avatar
34 votes
2 answers
57k views

gRPC + Image Upload

I want to create a simple gRPC endpoint which the user can upload his/her picture. The protocol buffer declaration is the following: message UploadImageRequest { AuthToken auth = 1; // An ...
Nate Lee's user avatar
  • 2,842
24 votes
3 answers
24k views

Deserialize unknown type with protobuf-net

I have 2 networked apps that should send serialized protobuf-net messages to each other. I can serialize the objects and send them, however, I cannot figure out how to deserialize the received bytes. ...
Nick VanderPyle's user avatar
23 votes
8 answers
10k views

C++ Serialization Performance

I'm building a distributed C++ application that needs to do lots of serialization and deserialization of simple data structures that's being passed between different processes and computers. I'm not ...
Laserallan's user avatar
  • 11.2k
21 votes
5 answers
22k views

What's the best way to represent System.Decimal in Protocol Buffers?

Following on from this question, what would be the best way to represent a System.Decimal object in a Protocol Buffer?
Cameron MacFarland's user avatar
9 votes
4 answers
12k views

How to create GRPC client directly from protobuf without compiling it into java code

When working with gRPC, we need to generate the gRPC client and server interfaces from our .proto service definition via protocol buffer compiler (protoc) or using Gradle or Maven protoc build plugin. ...
mtSiniChi's user avatar
232 votes
2 answers
184k views

Can I define a grpc call with a null request or response?

Does the rpc syntax in proto3 allow null requests or responses? e.g. I want the equivalent of the following: rpc Logout; rpc Status returns (Status); rpc Log (LogData); Or should I just create a null ...
user avatar
91 votes
17 answers
254k views

ImportError: No module named google.protobuf

I am following this guide and using the exact sample of addressbook.proto. Post the content of compiler generated addressbook_pb2.py file as well. When I run the following simple program, there is ...
Lin Ma's user avatar
  • 9,989
79 votes
3 answers
136k views

Handling null values in protobuffers

I am working on something which fetches data from database and constructs protobuff message. Given the possibility that null values can be fetched from the database for certain fields , I will get ...
Aarish Ramesh's user avatar
69 votes
1 answer
38k views

Protobuf: Will set_allocated_* delete the allocated object?

I have this small protobuf code (simplified, only the necessary is contained): message ParamsMessage { required int32 temperature = 1; } message MasterMessage { enum Type { GETPARAMS = 1; ...
Nidhoegger's user avatar
  • 5,111
66 votes
6 answers
58k views

what's the right way to do polymorphism with protocol buffers?

I'm trying to long-term serialize a bunch of objects related by a strong class hierarchy in java, and I'd like to use protocol buffers to do it due to their simplicity, performance, and ease of ...
user364003's user avatar
55 votes
7 answers
73k views

High performance serialization: Java vs Google Protocol Buffers vs ...?

For some caching I'm thinking of doing for an upcoming project, I've been thinking about Java serialization. Namely, should it be used? Now I've previously written custom serialization and ...
cletus's user avatar
  • 621k
45 votes
5 answers
119k views

How to convert from Json to Protobuf?

I'm new to using protobuf, and was wondering if there is a simple way to convert a json stream/string to a protobuf stream/string in Java? For example, protoString = convertToProto(jsonString) I have ...
Karan Tibrewal's user avatar
43 votes
2 answers
59k views

Protobuf3: How to describe map of repeated string?

The Official documentation about map type says: map<key_type, value_type> map_field = N; ...where the key_type can be any integral or string type (so, any scalar type except for ...
lz96's user avatar
  • 2,878
43 votes
2 answers
38k views

How do I generate a .proto file from a C# class decorated with attributes?

Trying to get my mind around google protobuf. I found some implementation of protobuf in C# but they seems to lack one feature: the ability to generate .proto files automatically from an existing C# ...
Stécy's user avatar
  • 12.2k
41 votes
6 answers
49k views

Google protocol buffers compare

I want to compare two Messages or (two sub parameters) of Google protocol buffers. I don't find an API to achieve it. Any ideas?
dimba's user avatar
  • 27.2k
27 votes
7 answers
31k views

How to solve the issue with Dalvik compiler limitation on 64K methods?

My team and I have inherited a large Android project from another team. The whole application with all the included libraries is reported to have around 35000 methods. We now have the task to ...
rfgamaral's user avatar
  • 16.7k
26 votes
5 answers
57k views

Copy a std::vector to a repeated field from protobuf with memcpy

At first I have this simple protobuf file message messagetest { ... repeated float samples = 6; .... } Which creates a headerfile with this methods //repeated float samples = 6; ...
akristmann's user avatar
19 votes
4 answers
22k views

Google protocol buffers on iOS

Is the metasyntactic static library for iOS . . . http://code.google.com/p/metasyntactic/wiki/ProtocolBuffers . . . compatible with regular old C++ compiled protofiles? I do not want to use the ...
learnvst's user avatar
  • 15.9k
18 votes
1 answer
4k views

protobuf-net serializing object graph

If I have object A and B both contain some field serialized field F, and both point to the same serializable object C. Does protobuf-net serialize by reference or serialize by value? When the object ...
jz87's user avatar
  • 9,399
15 votes
3 answers
36k views

How to decode protobuf binary response

I have created a test app that can recognize some image using Goggle Goggles. It works for me, but I receive binary protobuf response. I have no proto-files, just binary response. How can I get data ...
Igor's user avatar
  • 173
14 votes
4 answers
9k views

protobuf-net inheritance

Marc mentioned on stackoverflow that it will be possible in v2 of protobuf-net to use ProtoInclude attribute (or similar approach) to serialize/deserialize class hierarchy without a need to specify ...
Egor Pavlikhin's user avatar
14 votes
2 answers
14k views

How to build protocol buffer by Android NDK [closed]

I want to built a native version of Google's protocol buffers library. How would I do that?
papersnake's user avatar
12 votes
4 answers
18k views

Storing multiple messages in one protocol buffer binary file

I have repeating messages which I want to store in a single file. Currently I have to wrap this repeating message in another message. Is there a way around this? package foo; message Box { ...
Dat Chu's user avatar
  • 11k
10 votes
2 answers
5k views

connect input and output tensors of two different graphs tensorflow

I have 2 ProtoBuf Files, I currently load and forward pass each of them separately, by calling- out1=session.run(graph1out, feed_dict={graph1inp:inp1}) followed by final=session.run(graph2out, ...
Pranay Mathur's user avatar
5 votes
1 answer
5k views

No Operation named [input] in the Graph" error while fine tuning/retraining inceptionV1 slim model

I am trying to finetune/retrain InceptionV1 model here, on my own data. I was able to Convert the Image data to TFR format data using this. Pass the converted data to finetune_inception_v1_on_flowers ...
Subhash_Reddy's user avatar
3 votes
3 answers
6k views

decode websocket received data

I am working on project of my own website where I need to scrape data from target site using websocket. Data is live feed or tick for price movement of currency and stocks. I am getting output in ...
Cypher or KJ's user avatar
131 votes
15 answers
233k views

Installing Google Protocol Buffers on mac

I would like to install the older version of Google Protocol Buffers (protobuf-2.4.1) on Mac using the command line/Terminal app. I tried with brew install protobuf, but the latest version 2.5.0 has ...
informatiker's user avatar
  • 2,809
107 votes
5 answers
150k views

Protobuf to json in python

I have an object that I de-serialize using protobuf in Python. When I print the object it looks like a python object, however when I try to convert it to json I have all sorts of problems. For ...
exHash's user avatar
  • 1,195
87 votes
7 answers
158k views

Error using import in .proto file

I tried importing a proto file named test1.proto to another proto file named test2.proto using the import statement import "com/test/test1.proto"; But i get the following error com/test/test1....
Aarish Ramesh's user avatar
78 votes
11 answers
201k views

Java: JSON -> Protobuf & back conversion

I have an existing system, which is using protobuf-based communication protocol between GUI and server. Now I would like to add some persistence, but at the moment protobuf messages are straight ...
Denis Kulagin's user avatar
70 votes
8 answers
66k views

Performance comparison of Thrift, Protocol Buffers, JSON, EJB, other?

We're looking into transport/protocol solutions and were about to do various performance tests, so I thought I'd check with the community if they've already done this: Has anyone done server ...
Parand's user avatar
  • 105k
47 votes
2 answers
28k views

protoc not generating service stub files

I have just started playing with google proto. When I try to compile proto file present in proto-java example, it does not generate any grpc file. proto file, https://github.com/grpc/grpc-java/blob/...
Raman Sonkhla's user avatar
44 votes
11 answers
86k views

Correct format of protoc go_package?

I have an existing project in Go where I'm using Protocol buffers / gRPC. Until recent the go_package option was optional and the resulting Go package name would be the same as the proto package name. ...
Tim's user avatar
  • 1,750

1
2 3 4 5
16