def dataset_parser(self, value):
    'Parse an ImageNet record from a serialized string Tensor.'
    keys_to_features = {'image/encoded': tf.FixedLenFeature((), tf.string, ''), 'image/format': tf.FixedLenFeature((), tf.string, 'jpeg'), 'image/class/label': tf.FixedLenFeature([], tf.int64, (- 1)), 'image/class/text': tf.FixedLenFeature([], tf.string, ''), 'image/object/bbox/xmin': tf.VarLenFeature(dtype=tf.float32), 'image/object/bbox/ymin': tf.VarLenFeature(dtype=tf.float32), 'image/object/bbox/xmax': tf.VarLenFeature(dtype=tf.float32), 'image/object/bbox/ymax': tf.VarLenFeature(dtype=tf.float32), 'image/object/class/label': tf.VarLenFeature(dtype=tf.int64)}
    parsed = tf.parse_single_example(value, keys_to_features)
    image_bytes = tf.reshape(parsed['image/encoded'], shape=[])
    image = self.image_preprocessing_fn(image_bytes=image_bytes, is_training=self.is_training, use_bfloat16=self.use_bfloat16)
    label = tf.cast((tf.cast(tf.reshape(parsed['image/class/label'], shape=[1]), dtype=tf.int32) - 1), dtype=tf.float32)
    return (image, label)
Parse an ImageNet record from a serialized string Tensor.
def dataset_parser(self, value):
    
    keys_to_features = {'image/encoded': tf.FixedLenFeature((), tf.string, ), 'image/format': tf.FixedLenFeature((), tf.string, 'jpeg'), 'image/class/label': tf.FixedLenFeature([], tf.int64, (- 1)), 'image/class/text': tf.FixedLenFeature([], tf.string, ), 'image/object/bbox/xmin': tf.VarLenFeature(dtype=tf.float32), 'image/object/bbox/ymin': tf.VarLenFeature(dtype=tf.float32), 'image/object/bbox/xmax': tf.VarLenFeature(dtype=tf.float32), 'image/object/bbox/ymax': tf.VarLenFeature(dtype=tf.float32), 'image/object/class/label': tf.VarLenFeature(dtype=tf.int64)}
    parsed = tf.parse_single_example(value, keys_to_features)
    image_bytes = tf.reshape(parsed['image/encoded'], shape=[])
    image = self.image_preprocessing_fn(image_bytes=image_bytes, is_training=self.is_training, use_bfloat16=self.use_bfloat16)
    label = tf.cast((tf.cast(tf.reshape(parsed['image/class/label'], shape=[1]), dtype=tf.int32) - 1), dtype=tf.float32)
    return (image, label)