protocol-buffers

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

泪湿孤枕 提交于 2019-12-12 08:37:37
问题 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

Classpath set but java.lang.NoClassDefFoundError com/google/protobuf/MessageOrBuilder error?

旧时模样 提交于 2019-12-12 06:59:19
问题 I am trying to run a java program that uses protobuf.jar, but I keep getting this error. I have set my classpath variable in linux so that: CLASSPATH=/home/.../src/PlaceServer.class:/home/.../src/protobuf.jar:/home/.../src export CLASSPATH But then when I run my program in the command line after reading in the jar. java PServer I get this: java.lang.NoClassDefFoundError: com/google/protobuf/MessageOrBuilder However when I run another program that also reads the same jar, this one called

How to set google protobuf repeated field in java

左心房为你撑大大i 提交于 2019-12-12 06:19:33
问题 Here is my definition message point{ optional float x = 1; optional float y = 2; } message test{ repeated field point = 1; } In my example.java file I am trying to create a builder as follows: for(i = 0; i < somearr.size(); i++) { // I get x and y values from traversing the array float x = getX; float y = getY; // now I want to set the repeated field point } How do I set the repeated field points? 回答1: Very similar to repeated PhoneNumber example here. Capitalizing those messages will help

Protocol buffer serializing with inheritance. Derived classes are empty

≯℡__Kan透↙ 提交于 2019-12-12 05:42:13
问题 I faced with strange problem. After reading a lot, I tried to deploy protobuf-net in my app. Classes binds with simple inheritance. After presumably successful serialization, I am trying to deserialize to list, but protobuf filling only base class! here a bit of code: serializing function private static void serialize<T>(T obj) where T: Log { using (var fileStream = new FileStream(fileName, FileMode.Append)) { Serializer.SerializeWithLengthPrefix(fileStream, obj, PrefixStyle.Base128,

Reading protobuf in python. Extracting data

无人久伴 提交于 2019-12-12 05:36:08
问题 I am trying to work with data from spinn3r. The data is returned as a protobuf. In python, when I print the protobuf object, I get this: print data source { link { href: "" resource: "" } canonical_link { href: "http://twitter.com/_PattiShaw/statuses/28167079857225728" resource: "" } title: "" hashcode: "" lang { code: "en" probability: -1.0 } generator: "" description: "" last_posted: "" last_published: "" date_found: "" publisher_type: "MICROBLOG" } feed { link { href: "" resource: "" }

Protocol buffer with node.js - failed to generate js from .proto

谁说我不能喝 提交于 2019-12-12 04:07:53
问题 Trying to use google protocol buffer in my node.js web server with this documentation. When running the following command: protoc --js_out=import_style=commonjs,binary: ServiceMessage.proto I received: --js_out: : Unknown option: import_style Any suggestions? Cheers, Itay 回答1: Per this discussion line, the js_out is added recently and merge at Feb 20, you may updated your protoc with latest codes from protobuf. 来源: https://stackoverflow.com/questions/36156425/protocol-buffer-with-node-js

Seeing the float32 weight in a proto file

元气小坏坏 提交于 2019-12-12 04:04:50
问题 I have converted the Google Inception trained model .pb file which reads like bellow: A mixed_9/join/concat_dimConst* dtype0* value : A mixed_8/join/concat_dimConst* dtype0* value : A mixed_7/join/concat_dimConst* dtype0* value : A mixed_6/join/concat_dimConst* using Google Protobuf --decode_raw which reads from stdin. Now, the output reads as .proto file including the name of the layers and some encoded numbers. Here is the first 30 lines of .proto file: syntax="proto2"; 1 { 1: "mixed_10

Akka (JVM): Serialize an actorref with protobuf within another message

狂风中的少年 提交于 2019-12-12 03:54:12
问题 I have the following scala object that I would like to serialize with protobuf: case class Worker(id: String, ref: ActorRef) My understanding is that Akka comes with a ProtobufSerializer that I can use to serialize from/to ActorRef. Therefore I defined the following message in a proto file: message Worker { string id = 1; bytes ref = 2; } However the static methods ProtobufSerializer take an ExtentendActorSystem that I do not have at hand when I need to serialize those messages (only an

Receiving data from client on the server end failed

瘦欲@ 提交于 2019-12-12 03:53:24
问题 I have asked several questions about protocol buffers about socket transferring...again,I got a problem when I want to receive data at the server end from the client. here is the client end code: int sendSystem(int sockfd, const void *buf, size_t nbytes, int flags) { return ::send(sockfd, buf, nbytes, flags); } it's like the client do send data by integers standing for each byte.so the data was transferring in bytes. here is the server end code: GameRequest gameRequest=GameRequest.parseFrom

Error: Cannot find module 'google-protobuf'

 ̄綄美尐妖づ 提交于 2019-12-12 03:36:22
问题 Following to my previous question, I'm trying to use protocol buffers in node.js. I've generated ServiceMessage_pb.js from my ServiceMessage.proto , and add the following code: var messages = require('./ServiceMessage_pb'); Now I'm getting the following error in my node log: Error: Cannot find module 'google-protobuf' at Function.Module._resolveFilename (module.js:325:15) at Function.Module._load (module.js:276:25) at Module.require (module.js:353:17) at require (internal/module.js:12:17) at