tensorflow/models · error · ConfigurationError

Invalid YAML syntax in

Error message

Invalid YAML syntax in {yaml_path}: {err}

What it means

yaml.YAMLError translated to ConfigurationError in PipelineConfig.from_yaml: the file was read but safe_load failed to parse it — bad indentation, unclosed quotes or brackets, tabs used for indentation, or duplicate keys. The parser's message is embedded so the exact line/column of the syntax problem is visible, and the original exception is chained.

Solutions

  1. Read the embedded parser message for the offending line and column, then fix the YAML there
  2. Replace tabs with spaces and verify consistent indentation
  3. Validate with a YAML linter or a quick safe_load in a Python one-liner
  4. Check for unclosed quotes, brackets, or malformed block scalars
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at official/projects/waste_identification_ml/model_inference_with_tracking/sam3_dinov3_tracking_pipeline/config_loader.py:350 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/c2f8ba793015a2e5. Report an issue: GitHub.

Appendix: source

Thrown at official/projects/waste_identification_ml/model_inference_with_tracking/sam3_dinov3_tracking_pipeline/config_loader.py:350

    Args:
      yaml_path: Path to the YAML configuration file.

    Returns:
      A fully populated PipelineConfig.

    Raises:
      ConfigurationError: If the YAML file cannot be found, if the file content
        is invalid YAML, or if configuration validation fails.
    """
    try:
      with open(yaml_path, "r", encoding="utf-8") as file:
        data = yaml.safe_load(file)
    except OSError as err:
      raise ConfigurationError(
          f"Config file not found or inaccessible: {yaml_path}"
      ) from err
    except yaml.YAMLError as err:
      raise ConfigurationError(
          f"Invalid YAML syntax in {yaml_path}: {err}"
      ) from err

    if not isinstance(data, dict):
      raise ConfigurationError(
          f"Configuration root in {yaml_path} must be a dictionary."
      )

    try:
      prompt_configs = {}
      for name, cfg in data["detection"]["configs"].items():
        cfg_copy = dict(cfg)
        if "crop_size" in cfg_copy:
          cfg_copy["crop_size"] = tuple(cfg_copy["crop_size"])
        prompt_configs[name] = PromptConfig(**cfg_copy)

      classes = list(data["classes"])
      collapsed_categories = build_collapsed_categories_config(

View on GitHub (pinned to e006f5f0d5)