tensorflow:批量可变大小的图像 [英] tensorflow: batches of variable-sized images

查看:249
本文介绍了tensorflow:批量可变大小的图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当传递到tf.train.batch时,似乎必须严格定义元素的形状,否则,如果存在形状为Dimension(None)的张量,则会抱怨为All shapes must be fully defined.那么,如何训练一张不同尺寸的图像呢?

When one passes to tf.train.batch, it looks like the shape of the element has to be strictly defined, else it would complain that All shapes must be fully defined if there exist Tensors with shape Dimension(None). How, then, does one train on images of different sizes?

推荐答案

您可以在 tf.train.batch .

dynamic_pad:布尔值.允许输入形状中的尺寸可变.给定的尺寸在出队时填充,以使一批中的张量具有相同的形状.

dynamic_pad: Boolean. Allow variable dimensions in input shapes. The given dimensions are padded upon dequeue so that tensors within a batch have the same shapes.

这篇关于tensorflow:批量可变大小的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆