open-mmlab/mmdetection · error · RuntimeError

trackeval is not installed,please install it by: pip install

Error message

trackeval is not installed,please install it by: pip installgit+https://github.com/JonathonLuiten/TrackEval.gittrackeval need low version numpy, please install itby: pip install -U numpy==1.23.5

What it means

MOTChallengeMetric.__init__ raises RuntimeError when the `trackeval` package is not importable. Multi-object-tracking metrics (HOTA, MOTA, etc.) are computed by the external TrackEval library, which mmdet treats as an optional dependency; the message also warns that TrackEval needs numpy<=1.23.5.

Source

Thrown at mmdet/evaluation/metrics/mot_challenge_metric.py:93

    """
    TRACKER = 'default-tracker'
    allowed_metrics = ['HOTA', 'CLEAR', 'Identity']
    allowed_benchmarks = ['MOT15', 'MOT16', 'MOT17', 'MOT20', 'DanceTrack']
    default_prefix: Optional[str] = 'motchallenge-metric'

    def __init__(self,
                 metric: Union[str, List[str]] = ['HOTA', 'CLEAR', 'Identity'],
                 outfile_prefix: Optional[str] = None,
                 track_iou_thr: float = 0.5,
                 benchmark: str = 'MOT17',
                 format_only: bool = False,
                 use_postprocess: bool = False,
                 postprocess_tracklet_cfg: Optional[List[dict]] = [],
                 collect_device: str = 'cpu',
                 prefix: Optional[str] = None) -> None:
        super().__init__(collect_device=collect_device, prefix=prefix)
        if trackeval is None:
            raise RuntimeError(
                'trackeval is not installed,'
                'please install it by: pip install'
                'git+https://github.com/JonathonLuiten/TrackEval.git'
                'trackeval need low version numpy, please install it'
                'by: pip install -U numpy==1.23.5')
        if isinstance(metric, list):
            metrics = metric
        elif isinstance(metric, str):
            metrics = [metric]
        else:
            raise TypeError('metric must be a list or a str.')
        for metric in metrics:
            if metric not in self.allowed_metrics:
                raise KeyError(f'metric {metric} is not supported.')
        self.metrics = metrics
        self.format_only = format_only
        if self.format_only:
            assert outfile_prefix is not None, 'outfile_prefix must be not'

View on GitHub (pinned to cfd5d3a985)

Solutions

  1. pip install git+https://github.com/JonathonLuiten/TrackEval.git
  2. If trackeval is installed but the import fails, downgrade numpy: pip install -U numpy==1.23.5
  3. Verify with python -c "import trackeval" before launching the eval job

Example fix

// before
$ python tools/test.py mot_cfg.py ckpt.pth  # RuntimeError: trackeval is not installed
// after
$ pip install git+https://github.com/JonathonLuiten/TrackEval.git
$ pip install -U numpy==1.23.5
$ python tools/test.py mot_cfg.py ckpt.pth
Defensive patterns

Strategy: validation

Validate before calling

try:
    import trackeval  # noqa: F401
    ok = True
except Exception:
    ok = False
if not ok:
    raise SystemExit('Install: pip install git+https://github.com/JonathonLuiten/TrackEval.git && pip install numpy==1.23.5')

Try / catch

try:
    from mmdet.evaluation import MOTChallengeMetric
    m = MOTChallengeMetric(metric=['mota'])
except RuntimeError as e:
    if 'trackeval' in str(e):
        raise SystemExit('Missing trackeval; see install hint in error')
    raise

Prevention

When it happens

Trigger: Instantiating MOTChallengeMetric (val_evaluator=dict(type='MOTChallengeMetric')) in an environment where `import trackeval` failed (not installed, or failed to import due to a too-new numpy).

Common situations: Running MOT/VID tracking evaluation on a default mmdet install; a numpy>=1.24 upgrade breaking trackeval's use of np.float/np.int aliases so the import fails; fresh Docker/CI images without tracking extras.

Related errors


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