{"record":{"id":"e38bfad0730df1eb","repo":"tensorflow/models","slug":"pool-boxes-must-have-a-classes-field","errorCode":null,"errorMessage":"pool_boxes must have a 'classes' field","messagePattern":"pool_boxes must have a 'classes' field","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/vision/utils/object_detection/box_list_ops.py","lineNumber":898,"sourceCode":"  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\n  Args:\n    pool_boxes: (BoxList) A collection of boxes to be refined. pool_boxes must","sourceCodeStart":880,"sourceCodeEnd":916,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/vision/utils/object_detection/box_list_ops.py#L880-L916","documentation":"Error \"pool_boxes must have a 'classes' field\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/vision/utils/object_detection/box_list_ops.py:898 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add a 'classes' field to pool_boxes.","Call pool_boxes.add_field('classes', classes) 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"}