tensorflow/models · error · ConfigError

{context} must be a mapping.

Error message

{context} must be a mapping.

What it means

Error "{context} must be a mapping." thrown in tensorflow/models.

Source

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

def _validate_detection(
    raw_detection: Any, prompt_name: str
) -> DetectionConfig:
  """Validates one prompt's detection block into a DetectionConfig.

  Args:
      raw_detection: The ``detection`` mapping read from YAML.
      prompt_name: Prompt name used in error messages.

  Returns:
      A validated :class:`DetectionConfig`.

  Raises:
      ConfigError: If any field is missing or out of range.
  """
  context = f"prompts.{prompt_name!r}.detection"
  if not isinstance(raw_detection, dict):
    raise ConfigError(f"{context} must be a mapping.")
  _require_keys(raw_detection, _REQUIRED_DETECTION_KEYS, context)

  confidence_threshold = _require_number_in_range(
      raw_detection["confidence_threshold"],
      f"{context}.confidence_threshold",
      0.0,
      1.0,
  )
  score_threshold = _require_number_in_range(
      raw_detection["score_threshold"],
      f"{context}.score_threshold",
      0.0,
      1.0,
  )
  containment_threshold = _require_number_in_range(
      raw_detection["containment_threshold"],
      f"{context}.containment_threshold",
      0.0,

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:534 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/2014981acfbeff16. Report an issue: GitHub.