Tensor Flow Inlet Piping for Keras (TFRecords)

I have built an input pipeline for Tensorflow to read my data. It is encoded into TFRecord files. I would like to use QueueRunners to prefetch data and provide it as input to a Keras model.

Something like this:

image_batch, label_batch = MayTFRecordsPipeline.get_batch()
#Keras
model = Sequential()
model.add(Input(tensor=image_batch))

      

How does it work with QueueRunners? Internally, the pipeline uses (simplifies)

def get_batch():
    filename_queue = tf.train.string_input_producer(self.tfrecord_file_path_list)
    tf_keys, decoded_fs = self.decode_multiple_tfrecord(filename_queue)
    tensor_list = self.get_multiple_example(decoded_fs)                                            
    imageBatch, labelBatch= self.create_joined_shuffled_data_batch(tensor_list)
    return image_batch, label_batch

      

+3


source to share





All Articles