【发布时间】:2015-12-31 06:40:20
【问题描述】:
我正在尝试以与 TensorFlow 中的 cifar10 示例中所述类似的方式读取标签:
....
label_bytes = 2 # it was 1 in the original version
result.key, value = reader.read(filename_queue)
record_bytes = tf.decode_raw(value, tf.uint8)
result.label = tf.cast(tf.slice(record_bytes, [0], [label_bytes]), tf.int32)
....
问题是,如果label_byte 大于 1(例如 2),result.label 似乎变成了两个元素的张量(每个元素都是 1 字节)。我只想将连续的label_bytes 字节表示为单个值。我该怎么做?
谢谢
【问题讨论】:
标签: machine-learning computer-vision tensorflow