protocol-buffers

Using protoc-gen-go creates a .pb.go that imports google/golang but can't find package

隐身守侯 提交于 2019-12-04 04:27:07
问题 I'm using protoc-gen-go to compile C Protocol Buffers into Golang which works great and I can almost go install the package but I get this error: cannot find package "google/protobuf" but I cannot find this package anywhere to download, can anybody tell me what I should do with this? Thanks. I'm following all steps to doing it from here then I run protoc --go_out=. *.proto and I get all my files, but the wrong proto import 回答1: as @poopoothegoriall said, please use the protobuf from github,

Tensorflow Object Detection Training Killed, Resource starvation?

戏子无情 提交于 2019-12-04 04:25:35
问题 This question has partially been asked here and here with no follow-ups, so maybe this is not the venue to ask this question, but I've figured out a little more information that I'm hoping might get an answer to these questions. I've been attempting to train object_detection on my own library of roughly 1k photos. I've been using the provided pipeline config file "ssd_inception_v2_pets.config". And I've set up the training data properly, I believe. The program appears to start training just

How are shared/placed the int of the ProtoMember/ProtoInclude in ProtoBuf?

左心房为你撑大大i 提交于 2019-12-04 04:24:37
问题 I've several questions on how/where the ID of a [ProtoContract] should be declared. Imagine the following code: [ProtoContract] [ProtoInclude(100, typeof(SomeClassA))]//1) CAN I USE 1 here? public abstract class RootClass{ [ProtoMember(1)] public int NodeId {get;set;} } [ProtoContract] [ProtoInclude(200, typeof(SomeClassC)]//2) Should I declare this here or directly on the RootClass? //3) Can I use the id 100 here? //4) Can I use the id 1 here? or member + include share the id? public class

tensorflow difference between saving model via exporter and tf.train.write_graph()?

微笑、不失礼 提交于 2019-12-04 03:58:17
What is difference between saving a model by using exporter as specified in tensorflow serving: eg: from tensorflow.contrib.session_bundle import exporter #from tensorflow_serving.session_bundle import exporter saver = tf.train.Saver(sharded=True) model_exporter = exporter.Exporter(saver) model_exporter.init( sess.graph.as_graph_def(), named_graph_signatures={ 'inputs': exporter.generic_signature({'images': x}), 'outputs': exporter.generic_signature({'scores': y})}) model_exporter.export(export_path, tf.constant(FLAGS.export_version), sess) Using tf.train.write_graph() and tf.train.Saver()

Is protocol buffer serialization output fully deterministic?

强颜欢笑 提交于 2019-12-04 03:50:16
问题 Given a protocol buffers schema and some data, is the protocol buffers serialization deterministic across libraries and languages? Basically, am I guaranteed that the same data will always serialize in the same way (down to the byte) regardless of the library used? 回答1: In general, the same data will serialize in exactly the same way. However, this is not guaranteed by the protobuf specifications. For example, the following differences in encoding are allowable and must decode to the same

Calling parseFrom() method for generic protobuffer class in java

时光怂恿深爱的人放手 提交于 2019-12-04 03:44:35
I'm calling an api to get the an input stream and then call static method parseFrom(inputstream) to convert it to the protobuffclass. If I do it with a specific class it works: public CustomerDTOOuterClass.CustomerDTO GetCustomer() { CustomerDTOOuterClass.CustomerDTO customer = null; try { URL url = new URL("https://localhost:44302/Api/customer/1?"); HttpsURLConnection conn = (HttpsURLConnection)url.openConnection(); conn.setRequestMethod("GET"); conn.setRequestProperty("Content-Type", "application/x-protobuf"); conn.connect(); InputStream is = conn.getInputStream(); CustomerDTOOuterClass

gRPC/Protobuf 3 syntax: what is the difference between rpc lines that end with semicolon vs '{}'?

你离开我真会死。 提交于 2019-12-04 02:50:32
问题 I've seen two different ways of declaring an gRPC service using Protobuf v3. Some code has the rpc line end with a semicolon (such as the current proto3 documentation): service SearchService { rpc Search (SearchRequest) returns (SearchResponse); } Other code has the rpc line end with {} : service Greeter { rpc SayHello (HelloRequest) returns (HelloReply) {} } Both of these compile with the protoc v3.0.0-alpha-2 compiler and produce the same (go) code. What is the difference between the two

Undefined symbols for architecture i386 using protobuf

廉价感情. 提交于 2019-12-04 02:21:57
问题 I'm trying to make an app that uses Protocol Buffers. I'm getting this error, any idea why? Ld /Users/fmota/Library/Developer/Xcode/DerivedData/PBTest-gvudadeakgzklbekugyiqyfyprlt/Build/Products/Debug-iphonesimulator/PBTest.app/PBTest normal i386 cd /Users/fmota/Documents/Developer/Protobuf/PBTest setenv MACOSX_DEPLOYMENT_TARGET 10.6 setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" /Developer/Platforms

Can I send a custom Error message from server to client GRPC?

心不动则不痛 提交于 2019-12-04 00:16:17
I have created a simple GRPC server and client . What i want to do is to create a custom error in the server and pass it to the client. My code looks as follows: Server.js var error = require('error'); var PROTO_PATH = grpc.load(__dirname + '/proto/hello.proto'); var hello_proto = PROTO_PATH.hello; function sayHello(call, callback) { try { var jsErr = new Error('MY_ERROR'); jsErr.newStatus = 401; jsErr.newMessage = 'custom unAuthorized error'; console.log(Object.getOwnPropertyNames(jsErr)); console.log(jsErr); callback(jsErr); } catch(e) { callback(e); } } function sayHelloAgain(call, callback

How to best get a byte array from a ClientResponse from Spring WebClient?

主宰稳场 提交于 2019-12-04 00:14:25
I'm trying out the new WebClient from Spring 5 (5.0.0.RC2) in a codebase that uses reactive programming and I've had success mapping the JSON response from an endpoint to a DTO in my app, which works very nice: WebClient client = WebClient.create(baseURI); Mono<DTO> dto = client.get() .uri(uri) .accept(MediaType.APPLICATION_JSON) .exchange() .flatMap(response -> response.bodyToMono(DTO.class)); However, now I'm trying to the response body from an endpoint which uses Protocol Buffers (binary data served as application/octet-stream ), so I'd like to get the raw bytes from the response, which I