ultralytics/ultralytics · error · FileNotFoundError

No .axm file found in: {w}

Error message

No .axm file found in: {w}

What it means

The Axelera backend (ultralytics/nn/backends/axelera.py) loads a compiled .axm model by recursively searching the given weight path for '*.axm'. FileNotFoundError is raised when the directory holds no .axm artifact, meaning either the wrong directory was given or the Axelera compilation step never produced its output there.

Source

Thrown at ultralytics/nn/backends/axelera.py:39

        """Load an Axelera model from a directory containing a .axm file.

        Args:
            weight (str | Path): Path to the Axelera model directory containing the .axm binary.
        """
        try:
            from axelera.runtime import op
        except ImportError:
            check_requirements(
                "axelera-rt==1.7.0",
                cmds="--extra-index-url https://software.axelera.ai/artifactory/api/pypi/axelera-pypi/simple",
            )

        from axelera.runtime import op

        w = Path(weight)
        found = next(w.rglob("*.axm"), None)
        if found is None:
            raise FileNotFoundError(f"No .axm file found in: {w}")

        self.model = op.load(str(found)).optimized()

        # Load metadata
        metadata_file = found.parent / "metadata.yaml"
        if metadata_file.exists():
            from ultralytics.utils import YAML

            self.apply_metadata(YAML.load(metadata_file))

    def forward(self, im: torch.Tensor) -> list:
        """Run inference on the Axelera hardware accelerator.

        Args:
            im (torch.Tensor): Input image tensor in BCHW format, normalized to [0, 1].

        Returns:
            (list): Model predictions as a list of output arrays.

View on GitHub (pinned to 0449ea011c)

Solutions

  1. Confirm an .axm exists under the path: find <path> -name '*.axm' (search is recursive).
  2. If missing, re-run the Axelera export (yolo export model=yolo26n.pt format=axelera) with axelera-rt==1.7.0 installed, and use the returned directory.
  3. Make sure you point at the export directory that contains the .axm plus metadata.yaml, not the source model directory.

Example fix

# before
model = YOLO('yolo26n.pt_dir')  # no .axm inside -> FileNotFoundError

# after
model = YOLO('runs/export/yolo26n_axelera')  # contains yolo26n.axm + metadata.yaml
Defensive patterns

Strategy: validation

Validate before calling

from pathlib import Path

assert next(Path(export_dir).rglob('*.axm'), None) is not None, f'{export_dir} contains no .axm — re-export with format=axelera'
model = YOLO(export_dir)

Try / catch

try:
    model = YOLO(axelera_dir)
except FileNotFoundError as e:
    logger.error('Axelera .axm missing: %s', e)
    model = YOLO('yolo26n.onnx')  # only if hardware absent and onnx path acceptable

Prevention

When it happens

Trigger: AutoBackend dispatches to the Axelera class for an Axelera export directory that lacks any .axm file — wrong path, partially copied export folder, or an export that failed before the .axm was written while the directory still exists.

Common situations: Passing the .pt or onnx source directory instead of the compiled Axelera output; rsync/scp filters skipping the .axm binary; running inference before `yolo export format=axelera` (or the axelera-rt compiler) finished successfully.

Related errors


AI-assisted analysis of ultralytics/ultralytics@0449ea011c (2026-08-15). Data as JSON: /api/errors/24fb90898b2c267e. Report an issue: GitHub.