title: how to read tfrecord data into tensors/numpy arrays?
body: <p>I have a tfrecord file where i have stored a list of data with each element having 2d coordinates and 3d coordinates. the coordinates are 2d numpy arrays of dtype float64.</p>
  
  <p>these are the features i used to store them. </p>
  
  <pre><code>feature = {'train/coord2d': _floats_feature(projC),
                     'train/coord3d': _floats_feature(sChair)}
  </code></pre>
  
  <p>and i stored them by flattening them into a floatlist.</p>
  
  <pre><code>def _floats_feature(value):
      return tf.train.Feature(float_list=tf.train.FloatList(value=value.flatten()))
  </code></pre>
  
  <p>Now i am trying to recver them so i can feed them into my network to train it. I want the 2d coords to be the input and 3d to be the output for training my netwrok. </p>
  
  <pre><code>def read_and_decode(filename):
      filename_queue = tf.train.string_input_producer(filename, name='queue')
      reader = tf.TFRecordReader()
      _, serialized_example = reader.read(filename_queue)
      features = tf.parse_single_example(
      serialized_example,
  
      features= {'train/coord2d': tf.FixedLenFeature([], tf.float32),
              'train/coord3d': tf.FixedLenFeature([], tf.float32)})
  
      coord2d = tf.cast(features['train/coord2d'], tf.float32)
      coord3d = tf.cast(features['train/coord3d'], tf.float32)
  
      return coord2d, coord3d
  
  
  
  with tf.Session() as sess:
      filename = ["train.tfrecords"]
      dataset = tf.data.TFRecordDataset(filename)
      c2d, c3d = read_and_decode(filename)
     print(sess.run(c2d))
     print(sess.run(c3d))
  </code></pre>
  
  <p>this is my code but i dont really understand it since i got it from tutorials etc so i was trying to print out c2d and c3d to see what format theyre in but my program just kept running and didnt print anything at all and never terminated. do c2d and c3d contain the 2d and 3d coords for every element in the dataset? can they be directly used when training the network as input and output? </p>
  
  <p>I also dont know what format they should be before they can be used as input to the network. should i convert them back into 2d numpy arrays or 2d tensors? in which case how can i do it? overall im just very lost so any guidace would be extremely helpful! thanks</p>