import tensorflow as tf

filename_queue = \
    tf.train.string_input_producer(
        tf.train.match_filenames_once("./output/training-images/*.tfrecords"))

reader = tf.TFRecordReader()
_, serialized = reader.read(filename_queue)

features = tf.parse_single_example(
    serialized,
    features={
        'label': tf.FixedLenFeature([], tf.string)
        'image': tf.FixedLenFeature([], tf.string)
    })

record_image = tf.decode_raw(features['image'], tf.uint8)

image = tf.reshape(record_image, [250,151,1])

label= tf.cast(features['label'], tf.string)
min_after_dequeue = 10
batch_size = 3
capacity = min_after_dequeue + 3*batch_size

image_batch, label_batch = tf.train.shuffle_batch(
    [image_batch, label_batch], batch_size = batch_size,
    capacity = capacity, min_after_dequeue=min_after_dequeue)

