tensorflow/models · error · ConfigError
{field_name} must be one of {list(allowed_values)}, got {val
Error message
{field_name} must be one of {list(allowed_values)}, got {value!r}. What it means
Error "{field_name} must be one of {list(allowed_values)}, got {value!r}." thrown in tensorflow/models.
Source
Thrown at official/projects/waste_identification_ml/data_generation/auto_labeler_pipeline/config_loader.py:370
Each folder-name knob has exactly one allowed value declared in
``_ALLOWED_FOLDER_NAMES``. Any other value is rejected with a message
listing the allowed set.
Args:
value: The value to validate.
field_name: The top-level YAML field name (also the key into
``_ALLOWED_FOLDER_NAMES``).
Returns:
The validated string.
Raises:
ConfigError: If the value is not in the allowed set for that field.
"""
allowed_values = _ALLOWED_FOLDER_NAMES[field_name]
if value not in allowed_values:
raise ConfigError(
f"{field_name} must be one of {list(allowed_values)}, "
f"got {value!r}."
)
return value
def _validate_crop_size(
raw_crop_size: Any, prompt_name: str
) -> tuple[int, int]:
"""Validates and normalizes a crop_size entry into a tuple.
Args:
raw_crop_size: The value read from YAML; expected to be a two-element
sequence of positive integers.
prompt_name: Prompt name used in the error message.
Returns:
The crop size as a ``(height, width)`` tuple of ints.View on GitHub (pinned to e006f5f0d5)
When it happens
Trigger: Thrown at official/projects/waste_identification_ml/data_generation/auto_labeler_pipeline/config_loader.py:370 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/e39bdd08f289d8af.
Report an issue: GitHub.