protocol-buffers

Facing NoSuchMethodError for io.netty.util.AttributeKey.valueOf() method with grpc and protobuf Hello world example

[亡魂溺海] 提交于 2019-12-09 06:44:51
问题 After running GreetingServerTest.java tests I am getting below given errors. I am using grpc 1.1.0-SNAPSHOT libraries and trying to implement basic Helloword example of grpc given in there git repo. Can anybody please suggest which libraries I am missing or there's anything else I need to do. java.lang.NoSuchMethodError: io.netty.util.AttributeKey.valueOf(Ljava/lang/Class;Ljava/lang/String;)Lio/netty/util/AttributeKey; at io.grpc.netty.Utils.<clinit>(Utils.java:87) at io.grpc.netty

How to write comments in prototxt files?

旧城冷巷雨未停 提交于 2019-12-08 17:35:58
问题 I can't find how to write comments in prototxt files. Is there any way to have comments in a prototxt file, how? Thanks 回答1: You can comment by adding the # char: everything in the line after that is a comment: layer { name: "aLayerWithComments" # I picked this cool name by myself type: "ReLU" bottom: "someData" # this is the output of the layer below top: "someData" # same name means this is an "in-place" layer } # and now you can comment the entire line... 来源: https://stackoverflow.com

protobuf with inheritance?

ε祈祈猫儿з 提交于 2019-12-08 16:41:03
问题 Is it possible to use protobuf with classes who inherit? I want to do something like this class Expr; class AddExpr : Expr; class CallFunc: Expr; class FunctionBody{ repeatable Expr expr; } 回答1: Not in the core implementation - you would want to use encapsulation instead. However if you are using just protobuf-net, as code-first, I hack around it: [ProtoInclude(1, typeof(AddExpr))] [ProtoInclude(2, typeof(CallFunc))] [ProtoContract] class Expr {} [ProtoContract] class AddExpr : Expr {}

Turning on whole program optimization in some static library increases dramatically the library size !

a 夏天 提交于 2019-12-08 15:59:13
问题 In Visual Studio 2010, I have a C/C++ static library project. When I turn on the option whole program optimization in release mode, I obtain a .lib file exceeding 90 MB ! When I turn off this option the size is reduced to 24 MB. This library contains hundreds of classes generated with proto-buffer. I'm wondering why this option increases the size ? Under which conditions we must turn it off ? Edit : Changed MO to MB thanks chrisaycock 回答1: Whole program optimization means things are not

Protocol Buffer: Enum issue

蹲街弑〆低调 提交于 2019-12-08 15:56:38
问题 I have the following .proto file : enum Enum1{ X=0; Y=1; } message SomeClass{ required Enum1 enum1=1; required Enum2 enum2=2; } enum Enum2{ X=0; Z=1; } When I try to comile it using protoc , I get the following error : proto.proto:19:5: "X" is already defined proto.proto:19:5: Note that enum values use C++ scoping rules, meaning that enum values are siblings of their type, not children of it. Therefore, "X" must be unique , not just within "Enum2". I there any way I could overcome this issue

Java - train loaded tensorflow model

假如想象 提交于 2019-12-08 13:50:51
问题 Does anyone know if it is possible after a model is loaded into Java from Tensorflow Python to continue training the model? I've come up with this snippet of code, but did not work (yes, the output is the same as the input) for(int i = 0; i < 10000; i++) { Tensor cost = b.session().runner().feed("input", input).feed("output", input).fetch("cost").run().get(0); System.out.println(result1); } This is what is printed out 10000 times: FLOAT tensor with shape [] And after all, the predictions are

tensorflow dataset API doesn't work stably when batch size is greater than 1

家住魔仙堡 提交于 2019-12-08 11:00:10
问题 I put a group of fixed-length and variable-length features into one tf.train.SequenceExample. context_features length, scalar, tf.int64 site_code_raw, scalar, tf.string Date_Local_raw, scalar, tf.string Time_Local_raw, scalar, tf.string Sequence_features Orig_RefPts, [#batch, #RefPoints, 4] tf.float32 tgt_location, [#batch, 3] tf.float32 tgt_val [#batch, 1] tf.float32 The value of #RefPoints is variable for different sequence examples. I store its value in length feature in the context

NSMutableData to NSString - how to know which encoding to use for HTTP response

坚强是说给别人听的谎言 提交于 2019-12-08 10:44:10
问题 I'm using Google Protobuf to send a serialized class to an http server. The command to do this is: message.SerializeToString(&out); Notice that we are serializing to a String. The server returns the exact same object back to me. So, in my connection: didReceiveData method, I am getting data. - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData*)data { if (self.receivingData) { [self.dataReceived appendData:data]; } } In my connectionDidFinishLoading method I think I need to

Issue deserializing (protocolBuffer) serialized data using protobuf-net

空扰寡人 提交于 2019-12-08 07:44:10
问题 I serialized data using protobuf-net, and am able to deser the same in C#. putting a C# dummy w# var file = File.Create("animal.bin"); //Creating Msg - Fill the Data animal.id = "1"; animal.Name = "Rat"; animal.host = "Cheetha"; ProtoBuf.Serializer.SerializeWithLengthPrefix(file, animal, PrefixStyle.Base128, 1); animal.id = "2"; animal.Name = "Cat"; animal.host = "Cheetha"; ProtoBuf.Serializer.SerializeWithLengthPrefix(file, animal, PrefixStyle.Base128, 1); .... animal.id = "4"; animal.name =

How to compile google-fhir proto files

大憨熊 提交于 2019-12-08 07:12:51
问题 Looking at the readme for google-fhir it says to run bazel build , which works, however none of the protocol files have been compiled. Running protoc --proto_path=. --java_out=. proto/stu3/resources.proto returns a bunch of error about other protos not being found. This goes backwards until 'descriptor.proto' which is not a proto in the folder. None of the protocol files in that directory will manually compile into java files. *On another note, I was able to take other example protos from