{"record":{"id":"e3a776edf02359fb","repo":"tensorflow/models","slug":"nms-iou-thresh-must-be-between-0-and-1","errorCode":null,"errorMessage":"nms_iou_thresh must be between 0 and 1","messagePattern":"nms_iou_thresh must be between 0 and 1","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/vision/utils/object_detection/box_list_ops.py","lineNumber":890,"sourceCode":"  Args:\n    pool_boxes: (BoxList) A collection of boxes to be refined. pool_boxes must\n      have a rank 1 'scores' field and a rank 1 'classes' field.\n    num_classes: (int scalar) Number of classes.\n    nms_iou_thresh: (float scalar) iou threshold for non max suppression (NMS).\n    nms_max_detections: (int scalar) maximum output size for NMS.\n    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","sourceCodeStart":872,"sourceCodeEnd":908,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/vision/utils/object_detection/box_list_ops.py#L872-L908","documentation":"Error \"nms_iou_thresh must be between 0 and 1\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/vision/utils/object_detection/box_list_ops.py:890 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set nms_iou_thresh to a value between 0 and 1.","Clip the NMS IoU threshold into [0, 1] in the config."],"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"}