1. 程式人生 > >在佇列中讀取資料

在佇列中讀取資料

注意儲存的形式:list、tuple

image = tf.cast(image,tf.string)

input_queue = tf.train.slice_input_producer([image,label])
label = input_queue[1]
image_contents = tf.read_file(input_queue[0])

image = tf.image.decode_jpeg(image_contents,channels =3)
image = tf.image.resize_image_with_crop_or_pad(image, image_W, image_H)
image = tf.image.per_image_standardization(image)
image_batch, label_batch = tf.train.batch([image, label],batch_size = batch_size, num_threads = 64, capacity = capacity)
image_batch = tf.cast(image_batch,tf.float32)