tensorflow/models · error · ConfigError

is missing required field(s): .

Error message

{context} is missing required field(s): {', '.join(missing)}.

What it means

A ConfigError from the generic _require_keys validation helper. It fires at config-load time when the mapping named by context (e.g. a prompt's detection block) lacks one or more of the required keys, aborting before any dataset walk or GPU work.

Solutions

  1. Add the listed missing field(s) to the YAML block named in the message.
  2. Compare your config against the reference/template config to see all required fields.
  3. Check for YAML indentation mistakes that nest fields under the wrong block.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at official/projects/waste_identification_ml/data_generation/auto_labeler_pipeline/config_loader.py:269 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/d507ea2240dc71c5. Report an issue: GitHub.

Appendix: source

Thrown at official/projects/waste_identification_ml/data_generation/auto_labeler_pipeline/config_loader.py:269

def _require_keys(
    mapping: dict[str, Any],
    required_keys: tuple[str, ...],
    context: str,
) -> None:
  """Raises if any required key is absent from a mapping.

  Args:
      mapping: The mapping to inspect.
      required_keys: Keys that must be present.
      context: Human-readable description of where the mapping came from,
        used in the error message.

  Raises:
      ConfigError: If any required key is missing.
  """
  missing = [key for key in required_keys if key not in mapping]
  if missing:
    raise ConfigError(
        f"{context} is missing required field(s): {', '.join(missing)}."
    )


def _require_number_in_range(
    value: Any,
    field_name: str,
    minimum: float,
    maximum: float,
    allow_int: bool = True,
) -> float:
  """Validates that a value is a number within an inclusive range.

  Booleans are rejected explicitly because ``bool`` is a subclass of ``int``
  in Python and would otherwise slip through numeric checks.

  Args:
      value: The value to validate.

View on GitHub (pinned to e006f5f0d5)