{"record":{"id":"8e82ba7b940c3b9a","repo":"tensorflow/models","slug":"collapsed-categories-enable-is-true-but-mapping","errorCode":null,"errorMessage":"collapsed_categories.enable is true but 'mapping' is empty or missing.","messagePattern":"collapsed_categories\\.enable is true but 'mapping' is empty or missing\\.","errorType":"exception","errorClass":"ConfigurationError","httpStatus":null,"severity":"error","filePath":"official/projects/waste_identification_ml/model_inference_with_tracking/sam3_dinov3_tracking_pipeline/config_loader.py","lineNumber":274,"sourceCode":"      - Every class in the mapping must be present in `classes`.\n\n  Args:\n    raw_section: The raw `collapsed_categories` dict from YAML, or None if the\n      section was omitted entirely.\n    classes: The full list of class names from the config.\n\n  Returns:\n    A validated CollapsedCategoriesConfig instance.\n\n  Raises:\n    ConfigurationError: If validation fails.\n  \"\"\"\n  if raw_section is None or not raw_section.get(\"enable\", False):\n    return CollapsedCategoriesConfig(enable=False, mapping={})\n\n  raw_mapping = raw_section.get(\"mapping\") or {}\n  if not isinstance(raw_mapping, Mapping) or not raw_mapping:\n    raise ConfigurationError(\n        \"collapsed_categories.enable is true but 'mapping' is empty or \"\n        \"missing.\"\n    )\n\n  seen_classes: dict[str, str] = {}\n  mapping_dict: dict[str, list[str]] = {}\n  class_names = set(classes)\n  for category_name, class_list in raw_mapping.items():\n    if not isinstance(class_list, Sequence) or isinstance(class_list, str):\n      raise ConfigurationError(\n          f\"Category '{category_name}' must map to a list of class names.\"\n      )\n    if not class_list:\n      raise ConfigurationError(\n          f\"Category '{category_name}' must map to a non-empty list of class \"\n          \"names.\"\n      )\n    mapping_dict[str(category_name)] = list(class_list)","sourceCodeStart":256,"sourceCodeEnd":292,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/projects/waste_identification_ml/model_inference_with_tracking/sam3_dinov3_tracking_pipeline/config_loader.py#L256-L292","documentation":"Validation in build_collapsed_categories_config: the YAML set collapsed_categories.enable: true but the mapping entry is absent, empty, or not a dict-like Mapping. Since collapsing is enabled every class needs a target category; with no mapping there is nothing to collapse into, so from_yaml aborts. Typically a user enables the flag but forgets the mapping block, or indents it as a list or scalar instead of a map.","triggerScenarios":"Thrown at official/projects/waste_identification_ml/model_inference_with_tracking/sam3_dinov3_tracking_pipeline/config_loader.py:274 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add a 'mapping:' block under collapsed_categories mapping category names to lists of classes","If collapsing is not wanted, set enable: false or remove the collapsed_categories section","Ensure mapping is a YAML mapping (key: [class, ...]), not a list or scalar"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e006f5f0d534913e49c1f1dae87364039fa607e2","analyzedAt":"2026-08-24T14:09:15.576Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}