title: Tensorflow signature output placeholder
body: <p>I am trying to export a Tensorflow model so that I can use it in Tensorflow Serving. This is the script that I use:</p>
  
  <pre><code>import os
  import tensorflow as tf
  
  trained_checkpoint_prefix = '/home/ubuntu/checkpoint'
  export_dir = os.path.join('m', '0')
  
  loaded_graph = tf.Graph()
  config=tf.ConfigProto(allow_soft_placement=True)
  with tf.Session(graph=loaded_graph, config=config) as sess:
      # Restore from checkpoint
      loader = tf.train.import_meta_graph(trained_checkpoint_prefix + 'file.meta')
      loader.restore(sess, tf.train.latest_checkpoint(trained_checkpoint_prefix))
  
      # Create SavedModelBuilder class
      # defines where the model will be exported
      export_path_base = "/home/ubuntu/m"
      export_path = os.path.join(
          tf.compat.as_bytes(export_path_base),
          tf.compat.as_bytes(str(0)))
      print('Exporting trained model to', export_path)
      builder = tf.saved_model.builder.SavedModelBuilder(export_path)
  
      batch_shape = (20, 256, 256, 3)
      input_tensor = tf.placeholder(tf.float32, shape=batch_shape, name="X_content")
      predictions_tf = tf.placeholder(tf.float32, shape=batch_shape, name='Y_output')
  
      tensor_info_input = tf.saved_model.utils.build_tensor_info(input_tensor)
      tensor_info_output = tf.saved_model.utils.build_tensor_info(predictions_tf)
  
      prediction_signature = (
          tf.saved_model.signature_def_utils.build_signature_def(
              inputs={'image': tensor_info_input},
              outputs={'output': tensor_info_output},
              method_name=tf.saved_model.signature_constants.PREDICT_METHOD_NAME))
  
      builder.add_meta_graph_and_variables(
          sess, [tf.saved_model.tag_constants.SERVING],
          signature_def_map={
              'style_image':
                  prediction_signature,
          })
  
      builder.save(as_text=True)
  </code></pre>
  
  <p>The main issue is the output signature (predictions_tf). In this case, having it set to <em>placeholder</em>, I get an error saying that it's value has to be set when the model is called from gRPC. What should I use instead?</p>
  
  <p>I have tried</p>
  
  <pre><code>predictions_tf = tf.Variable(0, dtype=tf.float32, name="Y_output")
  </code></pre>
  
  <p>and</p>
  
  <pre><code>predictions_tf = tf.TensorInfo(dtype=tf.float32)
  predictions_tf.name = "Y_output"
  predictions_tf.dtype = tf.float32
  </code></pre>