tensorflow/models · error · ValueError

one_hot should be turned off if merge_multi_labels.

Error message

one_hot should be turned off if merge_multi_labels.

What it means

Error "one_hot should be turned off if merge_multi_labels." thrown in tensorflow/models.

Source

Thrown at official/projects/videoglue/datasets/common/utils.py:809

    input_label_name: The input label tensor name. The label should be the
      0-indexed, unique label per box.
    input_boxes_name: The input box tensor name.
    input_masks_name: The input binary mask tensor name.
    output_nonmerge_boxes_name: The output box name holding the none-merged
      might be duplicated boxes.
    output_nonmerge_label_name: The output label index per box.
    quantization_bins: The number of bins used to quantize the box coordinate.

  Returns:
    The output dictionary contains the merged multilabel labels/boxes and
      none-merged labels/boxes pairs.
  """
  unique_labels = inputs[input_label_name]
  unique_boxes = inputs[input_boxes_name]
  unique_weights = inputs[input_masks_name]

  if unique_labels.shape.rank != 2:
    raise ValueError('one_hot should be turned off if merge_multi_labels.')

  num_instances_per_frame = unique_boxes.shape.as_list()[-2]

  labels = tf.unstack(unique_labels, axis=0)
  boxes = tf.unstack(unique_boxes, axis=0)
  weights = tf.unstack(unique_weights, axis=0)

  merged_boxes = []
  merged_labels = []
  merged_weights = []

  def true_fn(box, label, weight,
              num_classes=num_classes,
              num_instances_per_frame=num_instances_per_frame,
              quantization_bins=quantization_bins):
    # The label is 0-index and the invalid labels are padded with -1. We create
    # a binary mask here to filter out the invalid/padded label.
    valid_mask = tf.greater(label, -1)

View on GitHub (pinned to e006f5f0d5)

When it happens

Trigger: Thrown at official/projects/videoglue/datasets/common/utils.py:809 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of tensorflow/models@e006f5f0d5 (2026-08-24). Data as JSON: /api/errors/c3be07da50c035e8. Report an issue: GitHub.