'Checks the extracted features are of correct shape.
Args:
feature_extractor: The feature extractor to test.
preprocessed_inputs: A [batch, height, width, 3] tensor to extract
features with.
expected_feature_map_shapes: The expected shape of the extracted features.'

def _validate_features_shape(self, feature_extractor, preprocessed_inputs, expected_feature_map_shapes):

    feature_maps = feature_extractor.extract_features(preprocessed_inputs)
    feature_map_shapes = [tf.shape(feature_map) for feature_map in feature_maps]
    init_op = tf.global_variables_initializer()
    with self.test_session() as sess:
        sess.run(init_op)
        feature_map_shapes_out = sess.run(feature_map_shapes)
        for (shape_out, exp_shape_out) in zip(feature_map_shapes_out, expected_feature_map_shapes):
            self.assertAllEqual(shape_out, exp_shape_out)
