{"record":{"id":"e39bdd08f289d8af","repo":"tensorflow/models","slug":"field-name-must-be-one-of-list-allowed-values","errorCode":null,"errorMessage":"{field_name} must be one of {list(allowed_values)}, got {value!r}.","messagePattern":"(.+?) must be one of (.+?), got (.+?)\\.","errorType":"exception","errorClass":"ConfigError","httpStatus":null,"severity":"error","filePath":"official/projects/waste_identification_ml/data_generation/auto_labeler_pipeline/config_loader.py","lineNumber":370,"sourceCode":"\n  Each folder-name knob has exactly one allowed value declared in\n  ``_ALLOWED_FOLDER_NAMES``. Any other value is rejected with a message\n  listing the allowed set.\n\n  Args:\n      value: The value to validate.\n      field_name: The top-level YAML field name (also the key into\n        ``_ALLOWED_FOLDER_NAMES``).\n\n  Returns:\n      The validated string.\n\n  Raises:\n      ConfigError: If the value is not in the allowed set for that field.\n  \"\"\"\n  allowed_values = _ALLOWED_FOLDER_NAMES[field_name]\n  if value not in allowed_values:\n    raise ConfigError(\n        f\"{field_name} must be one of {list(allowed_values)}, \"\n        f\"got {value!r}.\"\n    )\n  return value\n\n\ndef _validate_crop_size(\n    raw_crop_size: Any, prompt_name: str\n) -> tuple[int, int]:\n  \"\"\"Validates and normalizes a crop_size entry into a tuple.\n\n  Args:\n      raw_crop_size: The value read from YAML; expected to be a two-element\n        sequence of positive integers.\n      prompt_name: Prompt name used in the error message.\n\n  Returns:\n      The crop size as a ``(height, width)`` tuple of ints.","sourceCodeStart":352,"sourceCodeEnd":388,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/projects/waste_identification_ml/data_generation/auto_labeler_pipeline/config_loader.py#L352-L388","documentation":"Error \"{field_name} must be one of {list(allowed_values)}, got {value!r}.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/projects/waste_identification_ml/data_generation/auto_labeler_pipeline/config_loader.py:370 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e006f5f0d534913e49c1f1dae87364039fa607e2","analyzedAt":"2026-08-24T14:09:15.576Z","schemaVersion":2},"datasetVersion":"2026-08-24T17:17:21.512Z"}