{"record":{"id":"24fb90898b2c267e","repo":"ultralytics/ultralytics","slug":"no-axm-file-found-in-w","errorCode":null,"errorMessage":"No .axm file found in: {w}","messagePattern":"No \\.axm file found in: (.+?)","errorType":"exception","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"ultralytics/nn/backends/axelera.py","lineNumber":39,"sourceCode":"        \"\"\"Load an Axelera model from a directory containing a .axm file.\n\n        Args:\n            weight (str | Path): Path to the Axelera model directory containing the .axm binary.\n        \"\"\"\n        try:\n            from axelera.runtime import op\n        except ImportError:\n            check_requirements(\n                \"axelera-rt==1.7.0\",\n                cmds=\"--extra-index-url https://software.axelera.ai/artifactory/api/pypi/axelera-pypi/simple\",\n            )\n\n        from axelera.runtime import op\n\n        w = Path(weight)\n        found = next(w.rglob(\"*.axm\"), None)\n        if found is None:\n            raise FileNotFoundError(f\"No .axm file found in: {w}\")\n\n        self.model = op.load(str(found)).optimized()\n\n        # Load metadata\n        metadata_file = found.parent / \"metadata.yaml\"\n        if metadata_file.exists():\n            from ultralytics.utils import YAML\n\n            self.apply_metadata(YAML.load(metadata_file))\n\n    def forward(self, im: torch.Tensor) -> list:\n        \"\"\"Run inference on the Axelera hardware accelerator.\n\n        Args:\n            im (torch.Tensor): Input image tensor in BCHW format, normalized to [0, 1].\n\n        Returns:\n            (list): Model predictions as a list of output arrays.","sourceCodeStart":21,"sourceCodeEnd":57,"githubUrl":"https://github.com/ultralytics/ultralytics/blob/0449ea011cfd6c9a0d50a0bf1043aca5190cd476/ultralytics/nn/backends/axelera.py#L21-L57","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Confirm an .axm exists under the path: find <path> -name '*.axm' (search is recursive).","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.","Make sure you point at the export directory that contains the .axm plus metadata.yaml, not the source model directory."],"exampleFix":"# before\nmodel = YOLO('yolo26n.pt_dir')  # no .axm inside -> FileNotFoundError\n\n# after\nmodel = YOLO('runs/export/yolo26n_axelera')  # contains yolo26n.axm + metadata.yaml","handlingStrategy":"validation","validationCode":"from pathlib import Path\n\nassert next(Path(export_dir).rglob('*.axm'), None) is not None, f'{export_dir} contains no .axm — re-export with format=axelera'\nmodel = YOLO(export_dir)","typeGuard":null,"tryCatchPattern":"try:\n    model = YOLO(axelera_dir)\nexcept FileNotFoundError as e:\n    logger.error('Axelera .axm missing: %s', e)\n    model = YOLO('yolo26n.onnx')  # only if hardware absent and onnx path acceptable","preventionTips":["Verify axelera-rt==1.7.0 export completed (exit code 0) before deploying the output directory.","Keep .axm and metadata.yaml together; never copy only the metadata."],"tags":["axelera","file-not-found","export","inference-backend","path"],"backgroundTag":null,"analyzedSha":"0449ea011cfd6c9a0d50a0bf1043aca5190cd476","analyzedAt":"2026-08-15T02:34:13.413Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}