gpt4 book ai didi

machine-learning - tensorflow 中立体图像的批量学习

转载 作者:行者123 更新时间:2023-11-30 09:08:33 25 4
gpt4 key购买 nike

如何使用tf.readfile批量学习?

for i in range(len(files_mask)):
t_image_left = tf.read_file(files_left[i], name='read_fileimage_left')
t_image_right = tf.read_file(files_right[i], name='read_fileimage_right')
t_image_mask = tf.read_file(files_mask[i], name='read_fileimage_mask')
t_left = tf.image.decode_png(t_image_left, name='decode_png_t_left', dtype=tf.uint8)
t_right = tf.image.decode_png(t_image_right, name='decode_png_t_right', dtype=tf.uint8)
t_mask = tf.image.decode_png(t_image_mask, name='decode_png_t_mask', dtype=tf.uint8)

左右图像和掩模批处理应相互对应。左上批处理应该是所有图像中的左上批处理。

这可能吗: https://www.tensorflow.org/versions/r1.2/api_docs/python/tf/train/batch

最佳答案

您可以使用tf.train.batch,但还必须使用文件名队列,例如tf.train.slice_input_ Producer

filename_queue = tf.train.slice_input_producer([files_left, files_right, files_mask])
t_image_left = tf.read_file(filename_queue[0], name='read_fileimage_left')
t_image_right = tf.read_file(filename_queue[1], name='read_fileimage_right')
t_image_mask = tf.read_file(filename_queue[2], name='read_fileimage_mask')
t_left = tf.image.decode_png(t_image_left, name='decode_png_t_left', dtype=tf.uint8)
t_right = tf.image.decode_png(t_image_right, name='decode_png_t_right', dtype=tf.uint8)
t_mask = tf.image.decode_png(t_image_mask, name='decode_png_t_mask', dtype=tf.uint8
batch_left, batch_right, batch_mask = tf.train.batch([t_left, t_right, t_mask], batch_size=32, num_threads=1,
capacity=500, enqueue_many=False,)

关于machine-learning - tensorflow 中立体图像的批量学习,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46053177/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com