'Returns a map of variables to load from a foreign checkpoint.
See parent class for details.
Args:
from_detection_checkpoint: whether to restore from a full detection
checkpoint (with compatible variable names) or to restore from a
classification checkpoint for initialization prior to training.
Returns:
A dict mapping variable names (to load from a checkpoint) to variables in
the model graph.'

def restore_map(self, from_detection_checkpoint=True):

    if (not from_detection_checkpoint):
        return self._feature_extractor.restore_from_classification_checkpoint_fn(self.first_stage_feature_extractor_scope, self.second_stage_feature_extractor_scope)
    variables_to_restore = tf.global_variables()
    variables_to_restore.append(slim.get_or_create_global_step())
    feature_extractor_variables = tf.contrib.framework.filter_variables(variables_to_restore, include_patterns=[self.first_stage_feature_extractor_scope, self.second_stage_feature_extractor_scope])
    return {var.op.name: var for var in feature_extractor_variables}
