'Extracts first stage RPN features.
Args:
preprocessed_inputs: A [batch, height, width, channels] float32 tensor
representing a batch of images.
scope: A scope name.
Returns:
rpn_feature_map: A tensor with shape [batch, height, width, depth]
Raises:
InvalidArgumentError: If the spatial size of `preprocessed_inputs`
(height or width) is less than 33.
ValueError: If the created network is missing the required activation.'

def _extract_proposal_features(self, preprocessed_inputs, scope):

    if (len(preprocessed_inputs.get_shape().as_list()) != 4):
        raise ValueError(('`preprocessed_inputs`    must    be    4    dimensional,    got    a    tensor    of    shape    %s' % preprocessed_inputs.get_shape()))
    shape_assert = tf.Assert(tf.logical_and(tf.greater_equal(tf.shape(preprocessed_inputs)[1], 33), tf.greater_equal(tf.shape(preprocessed_inputs)[2], 33)), ['image    size    must    at    least    be    33    in    both    height    and    width.'])
    with tf.control_dependencies([shape_assert]):
        with slim.arg_scope(resnet_utils.resnet_arg_scope(batch_norm_epsilon=1e-05, batch_norm_scale=True, weight_decay=self._weight_decay)):
            with tf.variable_scope(self._architecture, reuse=self._reuse_weights) as var_scope:
                (_, activations) = self._resnet_model(preprocessed_inputs, num_classes=None, is_training=False, global_pool=False, output_stride=self._first_stage_features_stride, spatial_squeeze=False, scope=var_scope)
    handle = (scope + ('/%s/block3' % self._architecture))
    return activations[handle]
