{"record":{"id":"0609a92a3232328d","repo":"tensorflow/models","slug":"max-num-eval-detections-must-be-an-integer","errorCode":null,"errorMessage":"max_num_eval_detections must be an integer.","messagePattern":"max_num_eval_detections must be an integer\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/vision/evaluation/coco_evaluator.py","lineNumber":98,"sourceCode":"    if annotation_file:\n      if annotation_file.startswith('gs://'):\n        _, local_val_json = tempfile.mkstemp(suffix='.json')\n        tf.io.gfile.remove(local_val_json)\n\n        tf.io.gfile.copy(annotation_file, local_val_json)\n        atexit.register(tf.io.gfile.remove, local_val_json)\n      else:\n        local_val_json = annotation_file\n      self._coco_gt = coco_utils.COCOWrapper(\n          eval_type=('mask' if include_mask else 'box'),\n          annotation_file=local_val_json)\n    self._annotation_file = annotation_file\n    self._include_mask = include_mask\n    self._include_keypoint = include_keypoint\n    self._per_category_metrics = per_category_metrics\n    if max_num_eval_detections is None or not isinstance(\n        max_num_eval_detections, int):\n      raise ValueError('max_num_eval_detections must be an integer.')\n    self._metric_names = [\n        'AP', 'AP50', 'AP75', 'APs', 'APm', 'APl', 'ARmax1', 'ARmax10',\n        f'ARmax{max_num_eval_detections}', 'ARs', 'ARm', 'ARl'\n    ]\n    self.max_num_eval_detections = max_num_eval_detections\n    self._required_prediction_fields = [\n        'source_id', 'num_detections', 'detection_classes', 'detection_scores',\n        'detection_boxes'\n    ]\n    self._need_rescale_bboxes = need_rescale_bboxes\n    self._need_rescale_keypoints = need_rescale_keypoints\n    if self._need_rescale_bboxes or self._need_rescale_keypoints:\n      self._required_prediction_fields.append('image_info')\n    self._required_groundtruth_fields = [\n        'source_id', 'height', 'width', 'classes', 'boxes'\n    ]\n    if self._include_mask:\n      mask_metric_names = ['mask_' + x for x in self._metric_names]","sourceCodeStart":80,"sourceCodeEnd":116,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/vision/evaluation/coco_evaluator.py#L80-L116","documentation":"Error \"max_num_eval_detections must be an integer.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/vision/evaluation/coco_evaluator.py:98 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e006f5f0d534913e49c1f1dae87364039fa607e2","analyzedAt":"2026-08-24T14:09:15.576Z","schemaVersion":2},"datasetVersion":"2026-08-24T17:17:21.512Z"}