{"record":{"id":"f2cbb701a0a9b43b","repo":"open-mmlab/mmdetection","slug":"dataset-meta-or-class-names-are-missed-use-none-b","errorCode":null,"errorMessage":"dataset_meta or class names are missed, use None by default.","messagePattern":"dataset_meta or class names are missed, use None by default\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"mmdet/apis/inference.py","lineNumber":365,"sourceCode":"                value = checkpoint_meta['dataset_meta'].pop('CLASSES')\n                checkpoint_meta['dataset_meta']['classes'] = value\n            model.dataset_meta = checkpoint_meta['dataset_meta']\n\n    if detector is not None:\n        assert not (checkpoint and detector), \\\n            'Error: checkpoint and detector checkpoint cannot both exist'\n        load_checkpoint(model.detector, detector, map_location='cpu')\n\n    if reid is not None:\n        assert not (checkpoint and reid), \\\n            'Error: checkpoint and reid checkpoint cannot both exist'\n        load_checkpoint(model.reid, reid, map_location='cpu')\n\n    # Some methods don't load checkpoints or checkpoints don't contain\n    # 'dataset_meta'\n    # VIS need dataset_meta, MOT don't need dataset_meta\n    if not hasattr(model, 'dataset_meta'):\n        warnings.warn('dataset_meta or class names are missed, '\n                      'use None by default.')\n        model.dataset_meta = {'classes': None}\n\n    model.cfg = config  # save the config in the model for convenience\n    model.to(device)\n    model.eval()\n    return model\n","sourceCodeStart":347,"sourceCodeEnd":373,"githubUrl":"https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/mmdet/apis/inference.py#L347-L373","documentation":"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.","triggerScenarios":"Calling init_track_model(config, checkpoint, reid) where the detector or the loaded checkpoints lack 'dataset_meta' — common for MOT (DeepSORT etc.) configs.","commonSituations":"Running MOT demos; the warning is benign for pure tracking. If a VIS model hits it, downstream visualization needing class names will misbehave.","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"],"exampleFix":"// before\nmodel = init_track_model(mot_cfg, ckpt)\n// after (VIS case)\nmodel = init_track_model(vis_cfg, ckpt)\nmodel.dataset_meta = {'classes': vis_classes}","handlingStrategy":"validation","validationCode":"model = init_track_model(cfg, ckpt)\nif not hasattr(model, 'dataset_meta') or model.dataset_meta.get('classes') is None:\n    if needs_classes:  # VIS-style usage\n        model.dataset_meta = {'classes': my_classes}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["For VIS workflows, always set dataset_meta after init","Ignore safely for pure MOT"],"tags":["python","warning","tracking","dataset-meta","mot"],"backgroundTag":"missing-metadata-in-checkpoint","analyzedSha":"cfd5d3a985b0249de009b67d04f37263e11cdf3d","analyzedAt":"2026-08-27T20:54:20.183Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}