code: def build_graph(self):
      
  
      import tensorflow as tf
      input_jpeg = tf.placeholder(tf.string, shape=None)
      image = tf.image.decode_jpeg(input_jpeg, channels=self.CHANNELS)
  
      # Note resize expects a batch_size, but we are feeding a single image.
      # So we have to expand then squeeze.  Resize returns float32 in the
      # range [0, uint8_max]
      image = tf.expand_dims(image, 0)
  
      # convert_image_dtype also scales [0, uint8_max] -> [0 ,1).
      image = tf.image.convert_image_dtype(image, dtype=tf.float32)
      image = tf.image.resize_bilinear(
          image, [self.HEIGHT, self.WIDTH], align_corners=False)
  
      # Then rescale range to [-1, 1) for Inception.
      image = tf.subtract(image, 0.5)
      inception_input = tf.multiply(image, 2.0)
  
      # Build Inception layers, which expect a tensor of type float from [-1, 1)
      # and shape [batch_size, height, width, channels].
      with tf.contrib.slim.arg_scope(_inceptionlib.inception_v3_arg_scope()):
        _, end_points = _inceptionlib.inception_v3(inception_input, is_training=False)
  
      embedding = end_points['PreLogits']
      return input_jpeg, embedding
docs: Forms the core by building a wrapper around the inception graph.
  
        Here we add the necessary input & output tensors, to decode jpegs,
        serialize embeddings, restore from checkpoint etc.
  
        To use other Inception models modify this file. Note that to use other
        models beside Inception, you should make sure input_shape matches
        their input. Resizing or other modifications may be necessary as well.
        See tensorflow/contrib/slim/python/slim/nets/inception_v3.py for
        details about InceptionV3.
  
      Returns:
        input_jpeg: A tensor containing raw image bytes as the input layer.
        embedding: The embeddings tensor, that will be materialized later.