open-mmlab/mmdetection · error · NotImplementedError

Not supported YouTubeVIS datasetversion: {dataset_version}

Error message

Not supported YouTubeVIS datasetversion: {dataset_version}

What it means

YouTubeVisDataset.set_dataset_classes only accepts dataset_version '2019' or '2021', which select the matching class lists. Any other value raises NotImplementedError.

Source

Thrown at mmdet/datasets/youtube_vis_dataset.py:51

                                'eagle', 'earless_seal', 'tennis_racket')

        classes_2021_version = ('airplane', 'bear', 'bird', 'boat', 'car',
                                'cat', 'cow', 'deer', 'dog', 'duck',
                                'earless_seal', 'elephant', 'fish',
                                'flying_disc', 'fox', 'frog', 'giant_panda',
                                'giraffe', 'horse', 'leopard', 'lizard',
                                'monkey', 'motorbike', 'mouse', 'parrot',
                                'person', 'rabbit', 'shark', 'skateboard',
                                'snake', 'snowboard', 'squirrel', 'surfboard',
                                'tennis_racket', 'tiger', 'train', 'truck',
                                'turtle', 'whale', 'zebra')

        if dataset_version == '2019':
            cls.METAINFO = dict(classes=classes_2019_version)
        elif dataset_version == '2021':
            cls.METAINFO = dict(classes=classes_2021_version)
        else:
            raise NotImplementedError('Not supported YouTubeVIS dataset'
                                      f'version: {dataset_version}')

View on GitHub (pinned to cfd5d3a985)

Solutions

  1. Use dataset_version='2019' or dataset_version='2021' exactly
  2. Check the official youtube_vis config under configs/youtube_vis for the exact key

Example fix

# before
dataset_version='2022'
# after
dataset_version='2021'
Defensive patterns

Strategy: validation

Validate before calling

assert dataset_version in ('2019', '2021'), f'bad YouTubeVIS version: {dataset_version}'

Type guard

def is_valid_ytvis_version(v):
    return v in ('2019', '2021')

Prevention

When it happens

Trigger: Instantiating YouTubeVisDataset (or a config with type='YouTubeVisDataset') with dataset_version set to e.g. '2018', '2022', 'v2019', or omitted-but-typo'd values.

Common situations: Typos or assuming newer/older challenge years exist; case-sensitive version strings ('2019' not '2019_version').

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


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