{"record":{"id":"66d4aaab3151622d","repo":"tensorflow/models","slug":"class-class-name-is-assigned-to-both-seen-cl","errorCode":null,"errorMessage":"Class '{class_name}' is assigned to both '{seen_classes[class_name]}' and '{category_name}'.","messagePattern":"Class '(.+?)' is assigned to both '(.+?)' and '(.+?)'\\.","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":300,"sourceCode":"  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)\n    for class_name in class_list:\n      if class_name not in class_names:\n        raise ConfigurationError(\n            f\"Class '{class_name}' in category '{category_name}' is not \"\n            \"present in the top-level 'classes' list.\"\n        )\n      if class_name in seen_classes:\n        raise ConfigurationError(\n            f\"Class '{class_name}' is assigned to both \"\n            f\"'{seen_classes[class_name]}' and '{category_name}'.\"\n        )\n      seen_classes[class_name] = category_name\n\n  unmapped_classes = [c for c in classes if c not in seen_classes]\n  if unmapped_classes:\n    raise ConfigurationError(\n        \"The following classes are not assigned to any collapsed category: \"\n        f\"{unmapped_classes}\"\n    )\n\n  return CollapsedCategoriesConfig(enable=True, mapping=mapping_dict)\n\n\n@dataclasses.dataclass(frozen=True, kw_only=True)\nclass PipelineConfig:\n  \"\"\"Root configuration object representing the entire pipeline state.\"\"\"","sourceCodeStart":282,"sourceCodeEnd":318,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/projects/waste_identification_ml/model_inference_with_tracking/sam3_dinov3_tracking_pipeline/config_loader.py#L282-L318","documentation":"Duplicate-assignment validation in build_collapsed_categories_config: the same class name appears under two different categories (tracked via the seen_classes dict). A class can only collapse into one category; duplicates would make get_category_for_class ambiguous, so the loader reports both conflicting category names.","triggerScenarios":"Thrown at official/projects/waste_identification_ml/model_inference_with_tracking/sam3_dinov3_tracking_pipeline/config_loader.py:300 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Keep the class in only one category and delete it from the other","Split into two distinct class names if the classes are genuinely different concepts","Reorganize the categories so they are disjoint sets over the classes list"],"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"}