{"record":{"id":"20efab04ac084a2e","repo":"tensorflow/models","slug":"nms-version-not-supported","errorCode":null,"errorMessage":"NMS version {} not supported.","messagePattern":"NMS version (.+?) not supported\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/vision/modeling/layers/detection_generator.py","lineNumber":1102,"sourceCode":"                max_num_detections=self._config_dict['max_num_detections'],\n                soft_nms_sigma=self._config_dict['soft_nms_sigma'],\n            )\n        )\n      elif self._config_dict['nms_version'] == 'v2':\n        (nmsed_boxes, nmsed_scores, nmsed_classes, valid_detections) = (\n            _generate_detections_v2(\n                decoded_boxes,\n                box_scores,\n                pre_nms_top_k=self._config_dict['pre_nms_top_k'],\n                pre_nms_score_threshold=self._config_dict[\n                    'pre_nms_score_threshold'\n                ],\n                nms_iou_threshold=self._config_dict['nms_iou_threshold'],\n                max_num_detections=self._config_dict['max_num_detections'],\n            )\n        )\n      else:\n        raise ValueError(\n            'NMS version {} not supported.'.format(\n                self._config_dict['nms_version']\n            )\n        )\n\n    # Adds 1 to offset the background class which has index 0.\n    nmsed_classes += 1\n\n    return {\n        'num_detections': valid_detections,\n        'detection_boxes': nmsed_boxes,\n        'detection_classes': nmsed_classes,\n        'detection_scores': nmsed_scores,\n    }\n\n  def get_config(self):\n    return self._config_dict\n","sourceCodeStart":1084,"sourceCodeEnd":1120,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/vision/modeling/layers/detection_generator.py#L1084-L1120","documentation":"Error \"NMS version {} not supported.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/vision/modeling/layers/detection_generator.py:1102 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a supported NMS version: 1, 2, or the TFLite custom NMS option.","Check the nms_version value in the detection generator config for typos."],"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"}