title: Send a Keras model with gRPC
body: <p>I am trying to implement a Federated Learning system with gRPC.
  Tensorflow Federated currently supports multi-machine remote learning, but something looks weird to me that it prepares client dataset on the server side. I expected that the dataset for client only resides and is prepared only in client's device, not on server's memory.</p>
  
  <p>Tensors such as weight vectors are transferred well if i use <code>tensor_shape.proto, tensor.proto, types.proto, resource_handle.proto</code> and <code>tensor_util.make_tensor_proto()</code>which Tensorflow has been already using</p>
  
  <pre class="lang-py prettyprint-override"><code>hist = model.fit(...)
  vector = model.trainable_variables
  sending_tensors = []
  for v in vector:
      tensor = tensor_util.make_tensor_proto(v.numpy(), shape=v.numpy().shape)
      sending_tensors.append(tensor)
  #Some sending logic
  ...
  
  </code></pre>
  
  <p>But I couldn't find any kinds of "model.proto".
  I want to implement like the below as similar way as the above does.</p>
  
  <pre class="lang-py prettyprint-override"><code>#server
  model = tf.keras.models.Sequential([ ... ])
  model.compile(...)
  model_proto = some_package.make_model_proto()
  
  req = my_proto_pb2.Request(model=model_proto)
  client_stub.some_grpc_service(req)
  
  #client
  class SomeServicer(...):
    def some_grpc_service(self, request, context):
      model_proto = request.model
      model = some_package.model_from_proto(model_proto)
  
      model.compile(...)
      model.fit(...)
      ...
  
  </code></pre>
  
  <p>with a protobuf defined as</p>
  
  <pre class="lang-proto prettyprint-override"><code>message Request {
      ModelProto model = 1;
  }
  </code></pre>
  
  <p>This is not about the <code>Serving</code>, just about the transferring a keras model through gRPC from server to clients. Any ways to do it ?</p>
  
  <p>If not possible, am i supposed to send it simply as a stream of bytes read from <code>.h5</code> file created by <code>model.save()</code> ?</p>