tensorflow/models · error · ConfigurationError

Category '{category_name}' must map to a list of class names

Error message

Category '{category_name}' must map to a list of class names.

What it means

Error "Category '{category_name}' must map to a list of class names." thrown in tensorflow/models.

Source

Thrown at official/projects/waste_identification_ml/model_inference_with_tracking/sam3_dinov3_tracking_pipeline/config_loader.py:284

  Raises:
    ConfigurationError: If validation fails.
  """
  if raw_section is None or not raw_section.get("enable", False):
    return CollapsedCategoriesConfig(enable=False, mapping={})

  raw_mapping = raw_section.get("mapping") or {}
  if not isinstance(raw_mapping, Mapping) or not raw_mapping:
    raise ConfigurationError(
        "collapsed_categories.enable is true but 'mapping' is empty or "
        "missing."
    )

  seen_classes: dict[str, str] = {}
  mapping_dict: dict[str, list[str]] = {}
  class_names = set(classes)
  for category_name, class_list in raw_mapping.items():
    if not isinstance(class_list, Sequence) or isinstance(class_list, str):
      raise ConfigurationError(
          f"Category '{category_name}' must map to a list of class names."
      )
    if not class_list:
      raise ConfigurationError(
          f"Category '{category_name}' must map to a non-empty list of class "
          "names."
      )
    mapping_dict[str(category_name)] = list(class_list)
    for class_name in class_list:
      if class_name not in class_names:
        raise ConfigurationError(
            f"Class '{class_name}' in category '{category_name}' is not "
            "present in the top-level 'classes' list."
        )
      if class_name in seen_classes:
        raise ConfigurationError(
            f"Class '{class_name}' is assigned to both "
            f"'{seen_classes[class_name]}' and '{category_name}'."

View on GitHub (pinned to e006f5f0d5)

When it happens

Trigger: Thrown at official/projects/waste_identification_ml/model_inference_with_tracking/sam3_dinov3_tracking_pipeline/config_loader.py:284 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/cca11b3deb9f8676. Report an issue: GitHub.