I've been trying to get the TensorFlow io api to work this morning.
After some research, I managed to read in the data, but I can not bind image and label correctly when dequeuing.
Here is the code I wrote:
# load csv content
csv_path = tf.train.string_input_producer(['list1.csv', 'list2.csv'])
textReader = tf.TextLineReader()
_, csv_content = textReader.read(csv_path)
im_name, label = tf.decode_csv(csv_content, record_defaults=[[""], [1]])
# load images
im_content = tf.read_file(im_dir+im_name)
image = tf.image.decode_png(im_content, channels=3)
image = tf.cast(image, tf.float32) / 255.
image = tf.image.resize_images(image, 640, 640)
# make batches
im_batch, lb_batch = tf.train.batch([image, label], batch_size=batch)
The order of im_batch and lb_batch is messed up (the images are bound to random labels).
Any idea what's happening? Thanks.