def generate_train_batch(label, image, batch_size=FLAGS.batch_size):
num_preprocess_threads = 1
min_fraction_of_examples_in_queue = 0.5
min_queue_examples = int(NUM_EXAMPLES_PER_EPOCH_FOR_TRAIN * min_fraction_of_examples_in_queue)
images, label_batch = tf.train.shuffle_batch(
[image, label],
batch_size=batch_size,
num_threads=num_preprocess_threads,
capacity=min_queue_examples + 3 * batch_size,
# capacity=4,
min_after_dequeue=min_queue_examples
# min_after_dequeue=1
)
tf.image_summary('images', images)
return images, tf.reshape(label_batch, [batch_size])
评论列表
文章目录