open-mmlab/mmdetection · error · Exception

iouType not supported

Error message

iouType not supported

What it means

YTVISEvalParams.__init__ only accepts iouType 'segm', 'bbox', or 'keypoints' when selecting parameter presets; anything else raises 'iouType not supported'.

Source

Thrown at mmdet/evaluation/functional/ytviseval.py:620

        self.catIds = []
        # np.arange causes trouble.  the data point on arange
        # is slightly larger than the true value
        self.iouThrs = np.linspace(
            .5, 0.95, int(np.round((0.95 - .5) / .05)) + 1, endpoint=True)
        self.recThrs = np.linspace(
            .0, 1.00, int(np.round((1.00 - .0) / .01)) + 1, endpoint=True)
        self.maxDets = [20]
        self.areaRng = [[0**2, 1e5**2], [32**2, 96**2], [96**2, 1e5**2]]
        self.areaRngLbl = ['all', 'medium', 'large']
        self.useCats = 1

    def __init__(self, iouType='segm'):
        if iouType == 'segm' or iouType == 'bbox':
            self.setDetParams()
        elif iouType == 'keypoints':
            self.setKpParams()
        else:
            raise Exception('iouType not supported')
        self.iouType = iouType
        # useSegm is deprecated
        self.useSegm = None

View on GitHub (pinned to cfd5d3a985)

Solutions

  1. Use one of 'segm', 'bbox', 'keypoints'
  2. Note that 'keypoints' passes __init__ but later fails in computeIoU (error 72); prefer segm/bbox

Example fix

# before
YTVISEval(gt, dt, iouType='poly')
# after
YTVISEval(gt, dt, iouType='segm')
Defensive patterns

Strategy: validation

Validate before calling

assert iouType in ('segm', 'bbox', 'keypoints')

Type guard

def is_valid_iou_type(t) -> bool:
    return isinstance(t, str) and t in ('segm', 'bbox', 'keypoints')

Prevention

When it happens

Trigger: Constructing YTVISEval with iouType='mask', 'poly', or a misspelled value.

Common situations: Typos and adapting other eval APIs; passing the task name ('vis') instead of the iou type.

Related errors


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