在队列中读取数据

注意存储的形式: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)

猜你喜欢

转载自blog.csdn.net/weixin_41855385/article/details/84449407