code: def restore_from_checkpoint(self, session, inception_checkpoint_file,
                                trained_checkpoint_file):
      
      inception_exclude_scopes = [
          'InceptionV3/AuxLogits', 'InceptionV3/Logits', 'global_step',
          'final_ops'
      ]
      reader = tf.train.NewCheckpointReader(inception_checkpoint_file)
      var_to_shape_map = reader.get_variable_to_shape_map()
  
      # Get all variables to restore. Exclude Logits and AuxLogits because they
      # depend on the input data and we do not need to intialize them.
      all_vars = tf.contrib.slim.get_variables_to_restore(
          exclude=inception_exclude_scopes)
      # Remove variables that do not exist in the inception checkpoint (for
      # example the final softmax and fully-connected layers).
      inception_vars = {
          var.op.name: var
          for var in all_vars if var.op.name in var_to_shape_map
      }
      inception_saver = tf.train.Saver(inception_vars)
      inception_saver.restore(session, inception_checkpoint_file)
  
      # Restore the rest of the variables from the trained checkpoint.
      trained_vars = tf.contrib.slim.get_variables_to_restore(
          exclude=inception_exclude_scopes + inception_vars.keys())
      trained_saver = tf.train.Saver(trained_vars)
      trained_saver.restore(session, trained_checkpoint_file)
docs: To restore model variables from the checkpoint file.
  
         The graph is assumed to consist of an inception model and other
         layers including a softmax and a fully connected layer. The former is
         pre-trained and the latter is trained using the pre-processed data. So
         we restore this from two checkpoint files.
      Args:
        session: The session to be used for restoring from checkpoint.
        inception_checkpoint_file: Path to the checkpoint file for the Inception
                                   graph.
        trained_checkpoint_file: path to the trained checkpoint for the other
                                 layers.