【发布时间】:2020-05-04 08:24:33
【问题描述】:
我有一组50 形状为(50,128,128,1) 的图像,在TensorFlow 中表示为张量。假设25th 和30th 图像只是零图像,但我事先不知道哪些图像都为零(此示例中的25th 和30th 只是为了使情况更清楚)。我希望删除这些图像并拥有一个大小为(48,128,128,1) 的张量。如何在 Tensorflow 中实现这一点,而无需遍历张量 50 次的 0th 维度并检查每个图像是否为 tf.reduce_sum(tf.abs(image_i))>0。
【问题讨论】:
标签: tensorflow image-processing deep-learning tensor tensorflow-datasets