{"record":{"id":"6efb6bc3931bb21e","repo":"tensorflow/models","slug":"class-class-name-is-not-assigned-to-any-collap","errorCode":null,"errorMessage":"Class '{class_name}' is not assigned to any collapsed category.","messagePattern":"Class '(.+?)' is not assigned to any collapsed category\\.","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":226,"sourceCode":"\n    Args:\n      class_name: The fine-grained class name to look up.\n\n    Returns:\n      The matching category name when the feature is enabled, or None when the\n      feature is disabled.\n\n    Raises:\n      ConfigurationError: If the feature is enabled but the class is not present\n        in any category (this indicates the validation in `from_yaml` was\n        bypassed).\n    \"\"\"\n    if not self.enable:\n      return None\n    for category_name, class_list in self.mapping.items():\n      if class_name in class_list:\n        return category_name\n    raise ConfigurationError(\n        f\"Class '{class_name}' is not assigned to any collapsed category.\"\n    )\n\n  @property\n  def category_names(self) -> list[str]:\n    \"\"\"Returns the configured category names in declaration order.\n\n    Returns:\n      List of category names. Empty list when the feature is disabled.\n    \"\"\"\n    if not self.enable:\n      return []\n    return list(self.mapping.keys())\n\n\ndef build_collapsed_categories_config(\n    raw_section: Mapping[str, Any] | None, classes: Sequence[str]\n) -> CollapsedCategoriesConfig:","sourceCodeStart":208,"sourceCodeEnd":244,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/projects/waste_identification_ml/model_inference_with_tracking/sam3_dinov3_tracking_pipeline/config_loader.py#L208-L244","documentation":"Defensive sentinel in CollapsedCategoriesConfig.get_category_for_class: the feature is enabled and the lookup loop finished without finding class_name in any category's class list. from_yaml validates that every top-level class is mapped (the unmapped-classes error), so reaching this raise means that validation was bypassed — the config object was constructed directly in Python, mutated after parsing, or built with a hand-made mapping inconsistent with the classes list.","triggerScenarios":"Thrown at official/projects/waste_identification_ml/model_inference_with_tracking/sam3_dinov3_tracking_pipeline/config_loader.py:226 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Construct configs via PipelineConfig.from_yaml so the mapping-covers-all-classes invariant is enforced","If building programmatically, add the missing class to at least one category in the mapping","Avoid mutating classes or mapping after validation; rebuild the config instead"],"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"}