{"record":{"id":"23d559211fc474b5","repo":"tensorflow/models","slug":"field-name-must-be-a-number-got-value-r","errorCode":null,"errorMessage":"{field_name} must be a number, got {value!r}.","messagePattern":"(.+?) must be a number, got (.+?)\\.","errorType":"exception","errorClass":"ConfigError","httpStatus":null,"severity":"error","filePath":"official/projects/waste_identification_ml/data_generation/auto_labeler_pipeline/config_loader.py","lineNumber":301,"sourceCode":"  Booleans are rejected explicitly because ``bool`` is a subclass of ``int``\n  in Python and would otherwise slip through numeric checks.\n\n  Args:\n      value: The value to validate.\n      field_name: Field name used in the error message.\n      minimum: Inclusive lower bound.\n      maximum: Inclusive upper bound.\n      allow_int: Whether integer values are acceptable.\n\n  Returns:\n      The validated value as a float.\n\n  Raises:\n      ConfigError: If the value is not a number or is out of range.\n  \"\"\"\n  allowed_types = (int, float) if allow_int else (float,)\n  if isinstance(value, bool) or not isinstance(value, allowed_types):\n    raise ConfigError(f\"{field_name} must be a number, got {value!r}.\")\n  if not minimum <= value <= maximum:\n    raise ConfigError(\n        f\"{field_name} must be between {minimum} and {maximum}, \"\n        f\"got {value!r}.\"\n    )\n  return float(value)\n\n\ndef _require_positive_int(value: Any, field_name: str) -> int:\n  \"\"\"Validates that a value is a positive (non-zero) integer.\n\n  Args:\n      value: The value to validate.\n      field_name: Field name used in the error message.\n\n  Returns:\n      The validated integer.\n","sourceCodeStart":283,"sourceCodeEnd":319,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/projects/waste_identification_ml/data_generation/auto_labeler_pipeline/config_loader.py#L283-L319","documentation":"Error \"{field_name} must be a number, got {value!r}.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/projects/waste_identification_ml/data_generation/auto_labeler_pipeline/config_loader.py:301 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"}