{"record":{"id":"f0b191c24ab5760d","repo":"roboflow/supervision","slug":"predictions-must-have-shape-n-expected-pred-col","errorCode":null,"errorMessage":"Predictions must have shape (N, {expected_pred_cols}). Got {predictions[0].shape} instead.","messagePattern":"Predictions must have shape \\(N, (.+?)\\)\\. Got (.+?) instead\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/supervision/metrics/detection.py","lineNumber":211,"sourceCode":"        )\n    if len(predictions) > 0:\n        if not isinstance(predictions[0], np.ndarray) or not isinstance(\n            targets[0], np.ndarray\n        ):\n            raise ValueError(\n                \"Predictions and targets must be lists of numpy arrays. \"\n                f\"Got {type(predictions[0])} and {type(targets[0])} instead.\"\n            )\n\n        expected_pred_cols = (\n            10 if metric_target == MetricTarget.ORIENTED_BOUNDING_BOXES else 6\n        )\n        expected_target_cols = (\n            9 if metric_target == MetricTarget.ORIENTED_BOUNDING_BOXES else 5\n        )\n\n        if predictions[0].shape[1] != expected_pred_cols:\n            raise ValueError(\n                f\"Predictions must have shape (N, {expected_pred_cols}). \"\n                f\"Got {predictions[0].shape} instead.\"\n            )\n        if targets[0].shape[1] != expected_target_cols:\n            raise ValueError(\n                f\"Targets must have shape (N, {expected_target_cols}). \"\n                f\"Got {targets[0].shape} instead.\"\n            )\n\n\ndef _split_detections_by_outcome(\n    predictions: Detections,\n    targets: Detections,\n    conf_threshold: float,\n    iou_threshold: float,\n    metric_target: MetricTarget = MetricTarget.BOXES,\n) -> tuple[Detections, Detections, Detections]:\n    \"\"\"","sourceCodeStart":193,"sourceCodeEnd":229,"githubUrl":"https://github.com/roboflow/supervision/blob/7f254d9784d4c37e0f03cd89ddee164c8db099c0/src/supervision/metrics/detection.py#L193-L229","documentation":"Error \"Predictions must have shape (N, {expected_pred_cols}). Got {predictions[0].shape} instead.\" thrown in roboflow/supervision.","triggerScenarios":"Thrown at src/supervision/metrics/detection.py:211 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Shape each prediction array as (N, expected_pred_cols): box columns plus confidence/class as required.","Verify you are passing predictions, not targets, and that each row contains all required columns."],"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"}