I'm trying to read the label in a similar way as described in cifar10 example in TensorFlow:
....
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)
....
The problem is, if label_byte
is bigger than 1 (e.g.,2), result.label
seems to become a tensor of two elements (each of which is 1-byte). I just want to represent the consecutive label_bytes
of bytes into a single value. How do I do that?
Thanks
Create a second decoder, decode int16 with it and take the first element as your label
There's probably a better solution but it works.