tensorflow/models · error · ConfigurationError

Config file not found or inaccessible

Error message

Config file not found or inaccessible: {yaml_path}

What it means

OSError translated to ConfigurationError in PipelineConfig.from_yaml: open() on yaml_path failed — the file does not exist, the path is a directory, or permissions deny reading. The original OSError is chained (from err). Wrapping keeps the pipeline's error surface uniform: callers only need to catch ConfigurationError for any config problem.

Solutions

  1. Check the config path argument for typos; use an absolute path or the correct relative base
  2. Create the YAML file if it has not been written yet
  3. Fix file permissions (read access) if the file exists but cannot be opened
  4. Ensure the path is a file, not a directory
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:346 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/869d4ed8dbfd253d. Report an issue: GitHub.

Appendix: source

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

  @classmethod
  def from_yaml(cls, yaml_path: str) -> Self:
    """Parses the YAML file into a strictly typed configuration object.

    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"])

View on GitHub (pinned to e006f5f0d5)