title: How to read a Protobuf that was written by a TFRecordWriter
body: <p>I am trying to read data that was written with <code>tf.io.TFRecordWriter</code> as shown below:</p>
  
  <pre><code>import tensorflow as tf
  import numpy as np
  
  def _bytes_feature(value):
    """Returns a bytes_list from a string / byte."""
    if isinstance(value, type(tf.constant(0))):
      value = value.numpy() # BytesList won't unpack a string from an EagerTensor.
    return tf.train.Feature(bytes_list=tf.train.BytesList(value=[value]))
  
  tfrecord_filename = "test.tfrecord"
  with tf.io.TFRecordWriter(tfrecord_filename) as writer:
      for i in range(4):
          a  = np.random.uniform(-1, 1, 5)
          a = tf.convert_to_tensor(a, dtype=tf.float32)
          a = tf.io.serialize_tensor(a)
          feature = {
            'a'   : _bytes_feature(a),
          }
          example_proto = tf.train.Example(features=tf.train.Features(feature=feature))
          writer.write(example_proto.SerializeToString())  
  </code></pre>
  
  <p>I am then using the schema as given by:
  <a href="https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/example/feature.proto" rel="nofollow noreferrer">https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/example/feature.proto</a> and <a href="https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/example/example.proto" rel="nofollow noreferrer">https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/example/example.proto</a>
  along with protoc to decode it. The reading program is:</p>
  
  <pre><code>import test_pb2
  
  parser = test_pb2.Example()
  with open("test.tfrecord", "rb") as f:
      parser.ParseFromString(f.read())
      print(parser.feature)
  </code></pre>
  
  <p>Using the <code>ParseFromString</code> method I expect to be able to recover the data written after executing the above program but I consistently get:</p>
  
  <pre><code>RuntimeWarning: Unexpected end-group tag: Not all data was converted
  </code></pre>
  
  <p>What am I doing wrong? </p>