{"record":{"id":"04d99dfcd48c19b5","repo":"roboflow/supervision","slug":"the-number-of-predictions-len-predictions-and-04d99d","errorCode":null,"errorMessage":"The number of predictions ({len(predictions)}) and targets ({len(targets)}) during the update must be the same.","messagePattern":"The number of predictions \\((.+?)\\) and targets \\((.+?)\\) during the update must be the same\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/supervision/metrics/recall.py","lineNumber":144,"sourceCode":"        targets: Detections | list[Detections],\n    ) -> Recall:\n        \"\"\"\n        Add new predictions and targets to the metric, but do not compute the result.\n\n        Args:\n            predictions: The predicted detections.\n            targets: The target detections.\n\n        Returns:\n            The updated metric instance.\n        \"\"\"\n        if not isinstance(predictions, list):\n            predictions = [predictions]\n        if not isinstance(targets, list):\n            targets = [targets]\n\n        if len(predictions) != len(targets):\n            raise ValueError(\n                f\"The number of predictions ({len(predictions)}) and\"\n                f\" targets ({len(targets)}) during the update must be the same.\"\n            )\n\n        self._predictions_list.extend(predictions)\n        self._targets_list.extend(targets)\n\n        return self\n\n    def compute(self) -> RecallResult:\n        \"\"\"\n        Calculate the recall metric based on the stored predictions and ground-truth\n        data, at different IoU thresholds.\n\n        Returns:\n            The recall metric result.\n        \"\"\"\n        result = self._compute(self._predictions_list, self._targets_list)","sourceCodeStart":126,"sourceCodeEnd":162,"githubUrl":"https://github.com/roboflow/supervision/blob/7f254d9784d4c37e0f03cd89ddee164c8db099c0/src/supervision/metrics/recall.py#L126-L162","documentation":"Error \"The number of predictions ({len(predictions)}) and targets ({len(targets)}) during the update must be the same.\" thrown in roboflow/supervision.","triggerScenarios":"Thrown at src/supervision/metrics/recall.py:144 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass the same number of prediction and target Detections (one per image) to update().","Align your predictions and targets lists by image before calling update."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7f254d9784d4c37e0f03cd89ddee164c8db099c0","analyzedAt":"2026-08-15T05:13:01.950Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}