Commit 78007443 authored by Xin Pan's avatar Xin Pan Committed by GitHub
Browse files

Merge pull request #2024 from naurril/master

Offset of image bytes for cifar100 should be 2
parents 703bcbab a3b3220e
...@@ -58,7 +58,7 @@ def build_input(dataset, data_path, batch_size, mode): ...@@ -58,7 +58,7 @@ def build_input(dataset, data_path, batch_size, mode):
record = tf.reshape(tf.decode_raw(value, tf.uint8), [record_bytes]) record = tf.reshape(tf.decode_raw(value, tf.uint8), [record_bytes])
label = tf.cast(tf.slice(record, [label_offset], [label_bytes]), tf.int32) label = tf.cast(tf.slice(record, [label_offset], [label_bytes]), tf.int32)
# Convert from string to [depth * height * width] to [depth, height, width]. # Convert from string to [depth * height * width] to [depth, height, width].
depth_major = tf.reshape(tf.slice(record, [label_bytes], [image_bytes]), depth_major = tf.reshape(tf.slice(record, [label_offset + label_bytes], [image_bytes]),
[depth, image_size, image_size]) [depth, image_size, image_size])
# Convert from [depth, height, width] to [height, width, depth]. # Convert from [depth, height, width] to [height, width, depth].
image = tf.cast(tf.transpose(depth_major, [1, 2, 0]), tf.float32) image = tf.cast(tf.transpose(depth_major, [1, 2, 0]), tf.float32)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment