open-mmlab/mmdetection · warning

Pascal VOC2012 uses `area` as default evaluate mode, but you

Error message

Pascal VOC2012 uses `area` as default evaluate mode, but you are using {self.eval_mode}.

What it means

VOCMetric.compute_metrics() warns that VOC2012's standard protocol uses 'area' (all-points) interpolation for mAP, but the metric is configured otherwise (typically '11points'). Reported mAP will differ from official VOC2012 numbers.

Source

Thrown at mmdet/evaluation/metrics/voc_metric.py:132

        Returns:
            dict: The computed metrics. The keys are the names of the metrics,
            and the values are corresponding results.
        """
        logger: MMLogger = MMLogger.get_current_instance()
        gts, preds = zip(*results)
        eval_results = OrderedDict()
        if self.metric == 'mAP':
            assert isinstance(self.iou_thrs, list)
            dataset_type = self.dataset_meta.get('dataset_type')
            if dataset_type in ['VOC2007', 'VOC2012']:
                dataset_name = 'voc'
                if dataset_type == 'VOC2007' and self.eval_mode != '11points':
                    warnings.warn('Pascal VOC2007 uses `11points` as default '
                                  'evaluate mode, but you are using '
                                  f'{self.eval_mode}.')
                elif dataset_type == 'VOC2012' and self.eval_mode != 'area':
                    warnings.warn('Pascal VOC2012 uses `area` as default '
                                  'evaluate mode, but you are using '
                                  f'{self.eval_mode}.')
            else:
                dataset_name = self.dataset_meta['classes']

            mean_aps = []
            for iou_thr in self.iou_thrs:
                logger.info(f'\n{"-" * 15}iou_thr: {iou_thr}{"-" * 15}')
                # Follow the official implementation,
                # http://host.robots.ox.ac.uk/pascal/VOC/voc2012/VOCdevkit_18-May-2011.tar
                # we should use the legacy coordinate system in mmdet 1.x,
                # which means w, h should be computed as 'x2 - x1 + 1` and
                # `y2 - y1 + 1`
                mean_ap, _ = eval_map(
                    preds,
                    gts,
                    scale_ranges=self.scale_ranges,
                    iou_thr=iou_thr,

View on GitHub (pinned to cfd5d3a985)

Solutions

  1. Set eval_mode='area' in VOCMetric for VOC2012 datasets
  2. Verify dataset_type in dataset meta is 'VOC2012' and matches your data
  3. If comparing to VOC2007-style numbers deliberately, ignore the warning but document it

Example fix

# before
val_evaluator = dict(type='VOCMetric', metric='mAP', eval_mode='11points')
# after
val_evaluator = dict(type='VOCMetric', metric='mAP', eval_mode='area')  # VOC2012 default
Defensive patterns

Strategy: validation

Validate before calling

if dataset_meta['dataset_type'] == 'VOC2012':
    assert eval_mode == 'area', 'VOC2012 standard protocol is area'

Prevention

When it happens

Trigger: eval_mode != 'area' (e.g. '11points') combined with dataset_meta['dataset_type'] == 'VOC2012' in a VOCMetric mAP evaluation.

Common situations: Reusing a VOC2007 config on VOC2012 data, or defaulting eval_mode without adjusting per dataset year.

Related errors


AI-assisted analysis of open-mmlab/mmdetection@cfd5d3a985 (2026-08-27). Data as JSON: /api/errors/c1552ca01b317f22. Report an issue: GitHub.