{"record":{"id":"c3be07da50c035e8","repo":"tensorflow/models","slug":"one-hot-should-be-turned-off-if-merge-multi-labels","errorCode":null,"errorMessage":"one_hot should be turned off if merge_multi_labels.","messagePattern":"one_hot should be turned off if merge_multi_labels\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/projects/videoglue/datasets/common/utils.py","lineNumber":809,"sourceCode":"    input_label_name: The input label tensor name. The label should be the\n      0-indexed, unique label per box.\n    input_boxes_name: The input box tensor name.\n    input_masks_name: The input binary mask tensor name.\n    output_nonmerge_boxes_name: The output box name holding the none-merged\n      might be duplicated boxes.\n    output_nonmerge_label_name: The output label index per box.\n    quantization_bins: The number of bins used to quantize the box coordinate.\n\n  Returns:\n    The output dictionary contains the merged multilabel labels/boxes and\n      none-merged labels/boxes pairs.\n  \"\"\"\n  unique_labels = inputs[input_label_name]\n  unique_boxes = inputs[input_boxes_name]\n  unique_weights = inputs[input_masks_name]\n\n  if unique_labels.shape.rank != 2:\n    raise ValueError('one_hot should be turned off if merge_multi_labels.')\n\n  num_instances_per_frame = unique_boxes.shape.as_list()[-2]\n\n  labels = tf.unstack(unique_labels, axis=0)\n  boxes = tf.unstack(unique_boxes, axis=0)\n  weights = tf.unstack(unique_weights, axis=0)\n\n  merged_boxes = []\n  merged_labels = []\n  merged_weights = []\n\n  def true_fn(box, label, weight,\n              num_classes=num_classes,\n              num_instances_per_frame=num_instances_per_frame,\n              quantization_bins=quantization_bins):\n    # The label is 0-index and the invalid labels are padded with -1. We create\n    # a binary mask here to filter out the invalid/padded label.\n    valid_mask = tf.greater(label, -1)","sourceCodeStart":791,"sourceCodeEnd":827,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/projects/videoglue/datasets/common/utils.py#L791-L827","documentation":"Error \"one_hot should be turned off if merge_multi_labels.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/projects/videoglue/datasets/common/utils.py:809 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"}