{"record":{"id":"7bd6d8dcd01fd154","repo":"open-mmlab/mmdetection","slug":"motmetrics-is-not-installed-pleas-7bd6d8","errorCode":null,"errorMessage":"motmetrics is not installed,                 please install it by: pip install motmetrics","messagePattern":"motmetrics is not installed,                 please install it by: pip install motmetrics","errorType":"error_code","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"mmdet/models/trackers/strongsort_tracker.py","lineNumber":79,"sourceCode":"            Defaults to 0.7.\n        num_tentatives (int, optional): Number of continuous frames to confirm\n            a track. Defaults to 2.\n    \"\"\"\n\n    def __init__(self,\n                 motion: Optional[dict] = None,\n                 obj_score_thr: float = 0.6,\n                 reid: dict = dict(\n                     num_samples=None,\n                     img_scale=(256, 128),\n                     img_norm_cfg=None,\n                     match_score_thr=0.3,\n                     motion_weight=0.02),\n                 match_iou_thr: float = 0.7,\n                 num_tentatives: int = 2,\n                 **kwargs):\n        if motmetrics is None:\n            raise RuntimeError('motmetrics is not installed,\\\n                 please install it by: pip install motmetrics')\n        super().__init__(motion, obj_score_thr, reid, match_iou_thr,\n                         num_tentatives, **kwargs)\n\n    def update_track(self, id: int, obj: Tuple[Tensor]) -> None:\n        \"\"\"Update a track.\"\"\"\n        for k, v in zip(self.memo_items, obj):\n            v = v[None]\n            if self.momentums is not None and k in self.momentums:\n                m = self.momentums[k]\n                self.tracks[id][k] = (1 - m) * self.tracks[id][k] + m * v\n            else:\n                self.tracks[id][k].append(v)\n\n        if self.tracks[id].tentative:\n            if len(self.tracks[id]['bboxes']) >= self.num_tentatives:\n                self.tracks[id].tentative = False\n        bbox = bbox_xyxy_to_cxcyah(self.tracks[id].bboxes[-1])  # size = (1, 4)","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/mmdet/models/trackers/strongsort_tracker.py#L61-L97","documentation":"StrongSORT tracker construction checks that motmetrics imported successfully; if not, it raises RuntimeError. StrongSORT additionally needs a ReID model and KalmanFilter, but this specific error is purely the missing motmetrics package.","triggerScenarios":"tracker=dict(type='StrongSORTTracker', reid=...) built in an environment lacking py-motmetrics.","commonSituations":"Running StrongSORT configs (strongsort_yolox_x_8xb4-80e_mot17) on minimal mmdet installs or misconfigured conda envs.","solutions":["pip install motmetrics","Ensure the same interpreter is used (pip from the right conda env)","Install the other tracking extras (lap, scipy, scikit-learn) in one go"],"exampleFix":"# before: RuntimeError: motmetrics is not installed\n# after\npip install motmetrics lap scipy scikit-learn","handlingStrategy":"validation","validationCode":"import importlib.util\nassert importlib.util.find_spec('motmetrics'), 'pip install motmetrics'","typeGuard":null,"tryCatchPattern":"try:\n    tracker = StrongSORTTracker(...)\nexcept RuntimeError as e:\n    if 'motmetrics' in str(e):\n        raise SystemExit('Missing dependency: pip install motmetrics')\n    raise","preventionTips":["Use one requirements set for all trackers: motmetrics, lap, scipy, scikit-learn","Install extras in the same conda env used for training"],"tags":["mmdetection","tracking","strongsort","missing-dependency","motmetrics"],"backgroundTag":"missing-python-package","analyzedSha":"cfd5d3a985b0249de009b67d04f37263e11cdf3d","analyzedAt":"2026-08-27T20:54:20.183Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}