blakeblackshear/frigate · error · FileNotFoundError

No .dfp file found in custom model zip after extraction.

Error message

No .dfp file found in custom model zip after extraction.

What it means

After extracting the custom model zip, no *.dfp (MemryX compiled graph) file was found anywhere under the extraction directory. The zip is therefore not a valid MemryX model package; FileNotFoundError is raised during check_and_prepare_model in __init__.

Source

Thrown at frigate/detectors/plugins/memryx.py:236

                )
                if os.path.isdir(custom_dir):
                    shutil.rmtree(custom_dir)
                os.makedirs(custom_dir, exist_ok=True)

                with zipfile.ZipFile(self.memx_model_path, "r") as zip_ref:
                    zip_ref.extractall(custom_dir)
                logger.info(f"Custom model extracted to {custom_dir}.")

                # Find .dfp and optional *_post.onnx recursively
                dfp_candidates = glob.glob(
                    os.path.join(custom_dir, "**", "*.dfp"), recursive=True
                )
                post_candidates = glob.glob(
                    os.path.join(custom_dir, "**", "*_post.onnx"), recursive=True
                )

                if not dfp_candidates:
                    raise FileNotFoundError(
                        "No .dfp file found in custom model zip after extraction."
                    )

                self.memx_model_path = dfp_candidates[0]

                # Handle post model requirements by model type
                if self.memx_model_type in [
                    ModelTypeEnum.yolonas,
                    ModelTypeEnum.ssd,
                ]:
                    if not post_candidates:
                        raise FileNotFoundError(
                            f"No *_post.onnx file found in custom model zip for {self.memx_model_type.name}."
                        )
                    self.memx_post_model = post_candidates[0]
                elif self.memx_model_type in [
                    ModelTypeEnum.yolox,
                    ModelTypeEnum.yologeneric,

View on GitHub (pinned to ca18b8dc13)

Solutions

  1. Re-zip the package ensuring it directly contains the .dfp file (correct extension) at some level inside the archive
  2. If you only have an .onnx, compile it with MemryX tools (MIX/npu compiler) to produce a .dfp first
  3. Verify archive contents: unzip -l model.zip should show a .dfp entry

Example fix

# verify contents before configuring
unzip -l /models/custom.zip
# must include e.g. yolov6s.dfp (and yolov6s_post.onnx if required)
Defensive patterns

Strategy: validation

Validate before calling

import zipfile

def zip_has_dfp(path: str) -> bool:
    with zipfile.ZipFile(path) as z:
        return any(n.endswith('.dfp') for n in z.namelist())

Try / catch

try:
    detector = MemryXDetector(config)
except FileNotFoundError as e:
    if 'No .dfp file' in str(e):
        raise SystemExit('Zip lacks a .dfp; recompile with MemryX tools') from None
    raise

Prevention

When it happens

Trigger: Providing a .zip that contains onnx/tflite files or the dfp nested under an unexpected extension/renamed file, so glob for **/*.dfp returns nothing after extraction.

Common situations: User zips the wrong folder (source weights instead of compiled package); downloaded a generic onnx zip from model zoo; .dfp renamed or double-extension (model.dfp.bin) so the glob misses it.

Related errors


AI-assisted analysis of blakeblackshear/frigate@ca18b8dc13 (2026-08-27). Data as JSON: /api/errors/57369d29c658fad3. Report an issue: GitHub.