Questions tagged [protoc]

protoc is the compiler for .proto files. It generates language bindings for the messages and/or RPC services from .proto files. protoc is a native executable, the scripts under this directory build and publish a protoc executable (a.k.a. artifact) to Maven repositories. The artifact can be used by build automation tools so that users would not need to compile and install protoc for their systems.

taken from google documentation

387 questions
4
votes
1 answer

Reverse engineering .proto files from pb2.py generated with protoc

Is it possible to get proto files from generated pb2.py with protoc? Will be the same reverse engineering possible for gRPC?
4
votes
1 answer

How to get protoc to compile a proto with its dependencies?

I need to fix a grpc service, so I want to understand the logic around compiling them. In the example below, I don't understand why protoc doesn't compile the address.proto, since it's imported by person.proto. There are no build errors, so I don't…
bastien girschig
  • 663
  • 6
  • 26
4
votes
3 answers

ERROR when trying to compile protoc files: file not found or had errors

I am trying to compile protoc files using this command: protoc/bin/protoc models/research/object_detection/protos/*.proto --python_out=. but I am getting this output on cmd object_detection/protos/flexible_grid_anchor_generator.proto: File not…
Jenny
  • 375
  • 4
  • 6
  • 25
4
votes
1 answer

Protoc doesn't create service

I am just trying to generate code for golang using protocol buffer. But unable to generate the service using protoc command. syntax = "proto3"; package greet; option go_package="./greet/greetpb"; service GreetService{} Above is a dummy proto file…
4
votes
0 answers

Batch convert pandas dataframe to protobuf

I have a dataframe with about 1.5 million rows. I want to convert this to a protobuf. Naive method # generated with protoc import my_proto pb = my_proto.Table() for _, row in big_table.iterrows(): e = pb.rows.add() e.similarity =…
user82395214
  • 829
  • 14
  • 37
4
votes
0 answers

Why is the creation of Python protobuf messages so slow?

Say I have a message defined in test.proto as: message TestMessage { int64 id = 1; string title = 2; string subtitle = 3; string description = 4; } And I use protoc to convert it to Python like so: protoc --python_out=.…
Brendan Martin
  • 561
  • 6
  • 17
4
votes
1 answer

Build protoc for C++ with CMake

I'm currently working on a C++ project that reference gRPC as a git submodule and I'm using CMake to compile the dependencies and my sources. For that I basically have this in my CMakeLists.txt: ADD_SUBDIRECTORY(lib/grpc) Then I run: make…
Clément Jean
  • 1,735
  • 1
  • 14
  • 32
4
votes
1 answer

is there a way to compile python protobuf using gradle on windows?

I am trying to use gradle to compile proto files into python, a task that appears trivial for java, but for some reason does not work for python using anything I've tried so far. previously I've compiled .proto files into java using this tutorial:…
Lex
  • 41
  • 2
4
votes
0 answers

How the use decode option of protoc for decoding google::protobuf:any types

I try to decode a binary file which inherits some serialized proto3 messages. I do this with protoc and the option --decode. All work fine until one of the serialized messages contains a google::protobuf::Any field. This field contains another…
Flo
  • 41
  • 2
4
votes
3 answers

How can I add my own code to JAVA generated classes from proto file?

I'm using protobuf and I'm generating JAVA classes from the following proto file. syntax = "proto3"; enum Greeting { NONE = 0; MR = 1; MRS = 2; MISS = 3; } message Hello { Greeting greeting = 1; string name = 2; } message…
Alberto
  • 63
  • 1
  • 8
4
votes
1 answer

Error while importing another proto file

I get an error when I try to compile a proto file to convert to .java. Could you point out what I'm missing ? protoc --proto_path=src\main\resources\proto --java_out=src\main\java…
Sharat Chandra
  • 4,434
  • 7
  • 49
  • 66
4
votes
1 answer

How to include .proto files having mutual dependency

I have two .proto files, which has two packages that have mutual dependency. a.proto syntax = "proto3"; import "b.proto"; package a; message cert { string filename = 1; uint32 length = 2; } enum state { UP = 1; DOWN =…
4
votes
1 answer

libprotoc compiling protoc files but not other protoc included in it (google grpc assistant annotations.pb.h no file or directory error)

I am trying to generate Google Assistant library in C++. I have compiled the embedded_assistant.proto file using protoc compiler and obtained the embedded_assistant.grpc.pb.h and embedded_assistant.grpc.pb.cc files for library. I created a client…
4
votes
2 answers

How to use protoc for decoding protobuf files

I am so confused with the usage of protoc and cannot find examples on the internet regarding its usage:- protoc -IPATH=path_to_proto_file_directory path_to_proto_file --decode=MESSAGE_TYPE < ./request.protobuf So what is the message_type here…
Raj Hassani
  • 1,577
  • 1
  • 19
  • 26
4
votes
1 answer

Weights and Bias from Trained Meta Graph

I have successfully exported a re-trained InceptionV3 NN as a TensorFlow meta graph. I have read this protobuf back into python successfully, but I am struggling to see a way to export each layers weight and bias values, which I am assuming is…
Vinny M
  • 762
  • 4
  • 14