{"record":{"id":"145e1c0dfb791ad3","repo":"tensorflow/models","slug":"context-must-be-a-list-of-exactly-two-integers","errorCode":null,"errorMessage":"{context} must be a list of exactly two integers, got {raw_crop_size!r}.","messagePattern":"(.+?) must be a list of exactly two integers, got (.+?)\\.","errorType":"exception","errorClass":"ConfigError","httpStatus":null,"severity":"error","filePath":"official/projects/waste_identification_ml/data_generation/auto_labeler_pipeline/config_loader.py","lineNumber":395,"sourceCode":"def _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.\n\n  Raises:\n      ConfigError: If the value is not two positive integers.\n  \"\"\"\n  context = f\"prompts.{prompt_name!r}.detection.crop_size\"\n  if not isinstance(raw_crop_size, (list, tuple)) or len(raw_crop_size) != 2:\n    raise ConfigError(\n        f\"{context} must be a list of exactly two integers, \"\n        f\"got {raw_crop_size!r}.\"\n    )\n  height, width = raw_crop_size\n  _require_positive_int(height, f\"{context}[0]\")\n  _require_positive_int(width, f\"{context}[1]\")\n  return (int(height), int(width))\n\n\ndef _validate_crop_variants(raw_variants: Any) -> tuple[str, ...]:\n  \"\"\"Validates configured crop variants against the allowed set.\n\n  Args:\n      raw_variants: The value read from YAML; expected to be a non-empty\n        sequence of allowed variant names.\n\n  Returns:\n      The variants reordered to match ``ALLOWED_CROP_VARIANTS``, so on-disk","sourceCodeStart":377,"sourceCodeEnd":413,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/projects/waste_identification_ml/data_generation/auto_labeler_pipeline/config_loader.py#L377-L413","documentation":"Error \"{context} must be a list of exactly two integers, got {raw_crop_size!r}.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/projects/waste_identification_ml/data_generation/auto_labeler_pipeline/config_loader.py:395 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"}