How do I map a TFRecord Dataset to its labels in a pbtxt file?

Viewed 122

I'm very inexperienced with Tensorflow and ML in general. I am trying to follow the tutorial on https://www.tensorflow.org/tutorials/images/transfer_learning, but my dataset is structured as follows: I have a train.tfrecord file and a train_labels.pbtxt file with labels telling where in each image are the different objects located (the same goes for validation and test sets). So I need to map them into train_dataset before I run the following code:

history = model.fit(train_dataset,
                    epochs=initial_epochs,
                    validation_data=validation_dataset)

I know I have to normalize the dataset before using it with the keras.applications chosen model, and I probably have to use tf.data.TFRecordDataset(), but I don't understand the documentation at all. I have seen some tutorials where they use pipeline configuration files where they just indicate the path to these files, but that is not what I am trying to do.

Thank you for your help.

0 Answers
Related