protocol-buffers

Faster way to pass a numpy array through a protobuf message

Faster way to pass a numpy array through a protobuf message Question: I have a 921000 x 3 numpy array (921k 3D points, one point per row) that I am trying to pack into a protobuf message and I am running into performance issues. I have control over the protocol and can change it as …

Total answers: 1

Pybind11 – ImportError: …/pybindx.cpython-38-x86_64-linux-gnu.so: undefined symbol: _ZN6google8protobuf8internal26fixed_address_empty_stringB5cxx11E

Pybind11 – ImportError: …/pybindx.cpython-38-x86_64-linux-gnu.so: undefined symbol: _ZN6google8protobuf8internal26fixed_address_empty_stringB5cxx11E Question: I wrote some binding code to bind C++ code with python in pybindx.cpp file. I want to call some functions (implemented in C++) using python. When I use python setup.py build_ext command, the .so file ./build/lib.linux-x86_64-3.8/pybindx.cpython-38-x86_64-linux-gnu.so is getting created, but when I try to import(import pybindx) in …

Total answers: 1

Timestamp class missing in google.protobuf.timestamp_pb2 Python

Timestamp class missing in google.protobuf.timestamp_pb2 Python Question: I’m working with protobuf 3.20.1 in Python. However when I tried to use Timestamp, this error showed up: from google.protobuf import timestamp_pb2 timestamp = timestamp_pb2.Timestamp() ERROR: Cannot find reference ‘Timestamp’ in ‘timestamp_pb2.py’ Here is what I found in timestamp.proto syntax = "proto3"; package google.protobuf; option csharp_namespace = "Google.Protobuf.WellKnownTypes"; …

Total answers: 1

Deserializing Prometheus `remote_write` Protobuf output in Python

Deserializing Prometheus `remote_write` Protobuf output in Python Question: I’m experimenting (for the first time) with Prometheus. I’ve setup Prometheus to send messages to a local flask server: remote_write: – url: "http://localhost:5000/metric" I’m able to read the incoming bytes, however, I’m not able to convert the incoming messages to any meaningful data. I’m very new to …

Total answers: 1

Issue with version of protobuf in google sheets api

Issue with version of protobuf in google sheets api Question: I am trying to run the line ‘pip install google-api-python-client’ however I am receiving an error that my protobuf is version 4.12.12 but that it is not compatible. How can I fix this issue? Asked By: ohmygodimpregnant || Source Answers: pip install –upgrade protobuf==3.20.3. 3.20.3 …

Total answers: 1

Python protofub: how to pass response message from one grpc call to another

Python protofub: how to pass response message from one grpc call to another Question: I’m new to grpc/protobuf so please excuse any terminology errors in my question. I need to take a response from one gRPC request and feed it into the next request. I can’t figure out how to populate the "spec" line. Proto …

Total answers: 1

How to set a protobuf Timestamp field in python?

How to set a protobuf Timestamp field in python? Question: I am exploring the use of protocol buffers and would like to use the new Timestamp data type which is in protobuf3. Here is my .proto file: syntax = "proto3"; package shoppingbasket; import "google/protobuf/timestamp.proto"; message TransactionItem { optional string product = 1; optional int32 quantity …

Total answers: 3

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

How to solve "AttributeError: module 'google.protobuf.descriptor' has no attribute '_internal_create_key"? Question: 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 object detection api) The complete error log: AttributeError Traceback (most recent call last) <ipython-input-7-7035655b948a> in <module> 1 from object_detection.utils …

Total answers: 9