Commit f0505d26 authored by Jin Dong's avatar Jin Dong
Browse files

repeated cast

parent 0798c8ba
......@@ -477,7 +477,7 @@ class DatasetBuilder:
parsed = tf.io.parse_single_example(record, keys_to_features)
label = tf.reshape(parsed['image/class/label'], shape=[1])
label = tf.cast(label, dtype=tf.int32)
label = tf.cast(label, tf.int32)
# Subtract one so that labels are in [0, 1000)
label -= 1
......@@ -507,7 +507,6 @@ class DatasetBuilder:
standardize=self.config.standardize,
dtype=self.dtype)
label = tf.cast(label, tf.int32)
if self.config.one_hot:
label = tf.one_hot(label, self.num_classes)
label = tf.reshape(label, [self.num_classes])
......
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