先测试一下我的基本函数。我有以下python方法来读取数据:
def read_data(filename_queue):
# Whole file reader required for jpeg decoding
image_reader = tf.WholeFileReader()
# We don't care about the filename, so we ignore the first tuple
_, image_file = image_reader.read(filename_queue)
# Decode the jpeg images and set them to a universal size
# so we don't run into "out of bounds" issues down the road
image_orig = tf.image.decode_jpeg(image_file, channels=3)
image = tf.image.resize_images(image_orig, [224, 224])
return image
“filename_queue”是指向“images”子目录中单个jpeg文件的路径队列。我在文件名上运行一个for循环,以确保只有具有有效路径的文件添加到队列中:
^{pr2}$我想声明的是,图像被正确地读入,所有的数据都包含在整形后的张量中。我怎么能这么做?在
下面的代码可以为我的实验显示图像。也许这能帮到你。在
相关问题 更多 >
编程相关推荐