protoc

Protocol Buffer import resolution

霸气de小男生 提交于 2021-02-10 06:14:40
问题 Before reading through this rather long question, I've raised a bug https://github.com/GoogleCloudPlatform/python-docs-samples/issues/1103. The documentation for Proto Packages and Name Resolution states You can use definitions from other .proto files by importing them. To import another .proto's definitions, you add an import statement to the top of your file. My example.proto depends on annotations.proto to transcode HTTP/JSON to gRPC. This is a trivial example, but note I use the import

Why is my Protobuf message (in Python) ignoring zero values?

ぃ、小莉子 提交于 2021-02-04 17:16:40
问题 I've been working on implementing protobufs for IPC for a project. For some reason, values that are set to 0 are not being set/serialized. For context, the .proto file contains the following message: syntax = "proto3"; enum SetGet { SET = 0; GET = 1; } message State { SetGet setget = 1; double x = 2; double y = 3; double depth = 4; double yaw = 5; double pitch = 6; double roll = 7; } I compile the file to a Python _pb2 file with protoc, and then I try running the following test script: import

Is “google/protobuf/struct.proto” the best way to send dynamic JSON over GRPC?

限于喜欢 提交于 2020-12-29 05:49:31
问题 I have a written a simple GRPC server and a client to call the server (both in Go). Please tell me if using golang/protobuf/struct is the best way to send a dynamic JSON with GRPC. In the example below, earlier I was creating Details as a map[string]interface{} and serializing it. Then I was sending it in protoMessage as bytes and was de-serializing the message on the server side. Is it the best/efficient way to do it or should I define Details as a struct in my proto file? Below is User

Is “google/protobuf/struct.proto” the best way to send dynamic JSON over GRPC?

醉酒当歌 提交于 2020-12-29 05:48:19
问题 I have a written a simple GRPC server and a client to call the server (both in Go). Please tell me if using golang/protobuf/struct is the best way to send a dynamic JSON with GRPC. In the example below, earlier I was creating Details as a map[string]interface{} and serializing it. Then I was sending it in protoMessage as bytes and was de-serializing the message on the server side. Is it the best/efficient way to do it or should I define Details as a struct in my proto file? Below is User

Weights and Bias from Trained Meta Graph

不想你离开。 提交于 2020-12-29 04:41:59
问题 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 stored within the meta graph protobuf, for recreating the nn outside of TensorFlow. My workflow is as such: Retrain final layer for new categories Export meta graph tf.train.export_meta_graph(filename='model.meta') Build python pb2.py using Protoc and

protoc custom plugin erroring out with Program not found or is not executable

半城伤御伤魂 提交于 2020-06-09 05:37:45
问题 I am trying to build a custom protoc plugin to generate custom output from .proto files. I literally copied java file containing CodeGenerator from protoc custom plugin as a starting point and renamed it. I also followed executable and created .sh file. The content of my shell script is as follows. I also add the PATH variable value and output of the plugin execution. Can someone point me where I am going wrong with this? The shell script runs fine separately executing the main method 回答1:

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

三世轮回 提交于 2020-04-30 05:31:06
问题 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.20.0 // indirect ) I am running the following command: protoc -I ./src/pbdefs/protos/ --go-grpc_out=. src/pbdefs/protos/*.proto to generate my GRPC output files from .proto files, with I am getting an error protoc-gen-go-grpc: program not found or is not executable Please specify a program using absolute path

Protogen Vs. Protoc Compiler Options

有些话、适合烂在心里 提交于 2020-01-11 10:57:06
问题 I have some .proto files used to compile classes from Java, C++ and C#. For Java and C++ I use the Protoc compiler and for the C# I use Protogen. The scripts for the Java/C++ class creation is @ECHO OFF SET SRC_DIR=%~dp0 REM Make Java and C++ SET JAVA_OUT_DIR=%SRC_DIR%\..\taurus-messages-java\src\main\java if not exist %JAVA_OUT_DIR% ( mkdir %JAVA_OUT_DIR% ) SET CPP_OUT_DIR=%SRC_DIR%\..\taurus-messages-cpp if not exist %CPP_OUT_DIR% ( mkdir %CPP_OUT_DIR% ) protoc -I=%SRC_DIR% --java_out=%JAVA