import tensorflow as tf


    decoder = tf_example_decoder.TfExampleDecoder(
      load_instance_masks=False,
      num_additional_channels=predict_input_config.num_additional_channels)
    input_dict = transform_fn(decoder.decode(example))
    images = tf.cast(input_dict[fields.InputDataFields.image], dtype=tf.float32)
    images = tf.expand_dims(images, axis=0)
    true_image_shape = tf.expand_dims(
      input_dict[fields.InputDataFields.true_image_shape], axis=0)

    return tf.estimator.export.ServingInputReceiver(
      features={
        fields.InputDataFields.image: images,
        fields.InputDataFields.true_image_shape: true_image_shape},
      receiver_tensors={SERVING_FED_EXAMPLE_KEY: example})

  return _predict_input_fn