open-mmlab/mmdetection · info
dataset_meta or class names are missed, use None by default.
Error message
dataset_meta or class names are missed, use None by default.
What it means
Warning from init_track_model: the built tracking model has no dataset_meta attribute (checkpoints don't always carry it), so classes is set to None. MOT models don't need it, but video instance segmentation (VIS) does.
Source
Thrown at mmdet/apis/inference.py:365
value = checkpoint_meta['dataset_meta'].pop('CLASSES')
checkpoint_meta['dataset_meta']['classes'] = value
model.dataset_meta = checkpoint_meta['dataset_meta']
if detector is not None:
assert not (checkpoint and detector), \
'Error: checkpoint and detector checkpoint cannot both exist'
load_checkpoint(model.detector, detector, map_location='cpu')
if reid is not None:
assert not (checkpoint and reid), \
'Error: checkpoint and reid checkpoint cannot both exist'
load_checkpoint(model.reid, reid, map_location='cpu')
# Some methods don't load checkpoints or checkpoints don't contain
# 'dataset_meta'
# VIS need dataset_meta, MOT don't need dataset_meta
if not hasattr(model, 'dataset_meta'):
warnings.warn('dataset_meta or class names are missed, '
'use None by default.')
model.dataset_meta = {'classes': None}
model.cfg = config # save the config in the model for convenience
model.to(device)
model.eval()
return model
View on GitHub (pinned to cfd5d3a985)
Solutions
- For MOT: safe to ignore
- For VIS: load a checkpoint saved with dataset_meta, or set model.dataset_meta = {'classes': [...]} after init
- Update the config/dataset metainfo so the checkpoint retains classes
Example fix
// before
model = init_track_model(mot_cfg, ckpt)
// after (VIS case)
model = init_track_model(vis_cfg, ckpt)
model.dataset_meta = {'classes': vis_classes} Defensive patterns
Strategy: validation
Validate before calling
model = init_track_model(cfg, ckpt)
if not hasattr(model, 'dataset_meta') or model.dataset_meta.get('classes') is None:
if needs_classes: # VIS-style usage
model.dataset_meta = {'classes': my_classes} Prevention
- For VIS workflows, always set dataset_meta after init
- Ignore safely for pure MOT
When it happens
Trigger: Calling init_track_model(config, checkpoint, reid) where the detector or the loaded checkpoints lack 'dataset_meta' — common for MOT (DeepSORT etc.) configs.
Common situations: Running MOT demos; the warning is benign for pure tracking. If a VIS model hits it, downstream visualization needing class names will misbehave.
Related errors
- trackeval is not installed,please install it by: pip install
- metric must be a list or a str.
- metric {metric} is not supported.
- please run pip install seaborn
- dataset_meta or class names are not saved in the checkpoint'
AI-assisted analysis of open-mmlab/mmdetection@cfd5d3a985 (2026-08-27).
Data as JSON: /api/errors/f2cbb701a0a9b43b.
Report an issue: GitHub.