tensorflow/models · error · ConfigurationError
Class ' ' is not assigned to any collapsed category.
Error message
Class '{class_name}' is not assigned to any collapsed category. What it means
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.
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
Defensive patterns
Strategy: validation
When it happens
Trigger: 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.
Common situations: See trigger scenarios.
AI-assisted analysis of tensorflow/models@e006f5f0d5 (2026-08-24).
Data as JSON: /api/errors/6efb6bc3931bb21e.
Report an issue: GitHub.
Appendix: source
Thrown at official/projects/waste_identification_ml/model_inference_with_tracking/sam3_dinov3_tracking_pipeline/config_loader.py:226
Args:
class_name: The fine-grained class name to look up.
Returns:
The matching category name when the feature is enabled, or None when the
feature is disabled.
Raises:
ConfigurationError: If the feature is enabled but the class is not present
in any category (this indicates the validation in `from_yaml` was
bypassed).
"""
if not self.enable:
return None
for category_name, class_list in self.mapping.items():
if class_name in class_list:
return category_name
raise ConfigurationError(
f"Class '{class_name}' is not assigned to any collapsed category."
)
@property
def category_names(self) -> list[str]:
"""Returns the configured category names in declaration order.
Returns:
List of category names. Empty list when the feature is disabled.
"""
if not self.enable:
return []
return list(self.mapping.keys())
def build_collapsed_categories_config(
raw_section: Mapping[str, Any] | None, classes: Sequence[str]
) -> CollapsedCategoriesConfig:View on GitHub (pinned to e006f5f0d5)