{"record":{"id":"68bc9497a2908ec2","repo":"tensorflow/models","slug":"pool-boxes-must-have-a-scores-field","errorCode":null,"errorMessage":"pool_boxes must have a 'scores' field","messagePattern":"pool_boxes must have a 'scores' field","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/vision/utils/object_detection/box_list_ops.py","lineNumber":896,"sourceCode":"    voting_iou_thresh: (float scalar) iou threshold for box voting.\n\n  Returns:\n    BoxList of refined boxes.\n\n  Raises:\n    ValueError: if\n      a) nms_iou_thresh or voting_iou_thresh is not in [0, 1].\n      b) pool_boxes is not a BoxList.\n      c) pool_boxes does not have a scores and classes field.\n  \"\"\"\n  if not 0.0 <= nms_iou_thresh <= 1.0:\n    raise ValueError('nms_iou_thresh must be between 0 and 1')\n  if not 0.0 <= voting_iou_thresh <= 1.0:\n    raise ValueError('voting_iou_thresh must be between 0 and 1')\n  if not isinstance(pool_boxes, box_list.BoxList):\n    raise ValueError('pool_boxes must be a BoxList')\n  if not pool_boxes.has_field('scores'):\n    raise ValueError('pool_boxes must have a \\'scores\\' field')\n  if not pool_boxes.has_field('classes'):\n    raise ValueError('pool_boxes must have a \\'classes\\' field')\n\n  refined_boxes = []\n  for i in range(num_classes):\n    boxes_class = filter_field_value_equals(pool_boxes, 'classes', i)\n    refined_boxes_class = refine_boxes(boxes_class, nms_iou_thresh,\n                                       nms_max_detections, voting_iou_thresh)\n    refined_boxes.append(refined_boxes_class)\n  return sort_by_field(concatenate(refined_boxes), 'scores')\n\n\ndef refine_boxes(pool_boxes,\n                 nms_iou_thresh,\n                 nms_max_detections,\n                 voting_iou_thresh=0.5):\n  \"\"\"Refines a pool of boxes using non max suppression and box voting.\n","sourceCodeStart":878,"sourceCodeEnd":914,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/vision/utils/object_detection/box_list_ops.py#L878-L914","documentation":"Error \"pool_boxes must have a 'scores' field\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/vision/utils/object_detection/box_list_ops.py:896 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add a 'scores' field to pool_boxes.","Call pool_boxes.add_field('scores', scores) first."],"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"}