{"record":{"id":"57369d29c658fad3","repo":"blakeblackshear/frigate","slug":"no-dfp-file-found-in-custom-model-zip-after-extra","errorCode":null,"errorMessage":"No .dfp file found in custom model zip after extraction.","messagePattern":"No \\.dfp file found in custom model zip after extraction\\.","errorType":"exception","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"frigate/detectors/plugins/memryx.py","lineNumber":236,"sourceCode":"                )\n                if os.path.isdir(custom_dir):\n                    shutil.rmtree(custom_dir)\n                os.makedirs(custom_dir, exist_ok=True)\n\n                with zipfile.ZipFile(self.memx_model_path, \"r\") as zip_ref:\n                    zip_ref.extractall(custom_dir)\n                logger.info(f\"Custom model extracted to {custom_dir}.\")\n\n                # Find .dfp and optional *_post.onnx recursively\n                dfp_candidates = glob.glob(\n                    os.path.join(custom_dir, \"**\", \"*.dfp\"), recursive=True\n                )\n                post_candidates = glob.glob(\n                    os.path.join(custom_dir, \"**\", \"*_post.onnx\"), recursive=True\n                )\n\n                if not dfp_candidates:\n                    raise FileNotFoundError(\n                        \"No .dfp file found in custom model zip after extraction.\"\n                    )\n\n                self.memx_model_path = dfp_candidates[0]\n\n                # Handle post model requirements by model type\n                if self.memx_model_type in [\n                    ModelTypeEnum.yolonas,\n                    ModelTypeEnum.ssd,\n                ]:\n                    if not post_candidates:\n                        raise FileNotFoundError(\n                            f\"No *_post.onnx file found in custom model zip for {self.memx_model_type.name}.\"\n                        )\n                    self.memx_post_model = post_candidates[0]\n                elif self.memx_model_type in [\n                    ModelTypeEnum.yolox,\n                    ModelTypeEnum.yologeneric,","sourceCodeStart":218,"sourceCodeEnd":254,"githubUrl":"https://github.com/blakeblackshear/frigate/blob/ca18b8dc131ccb3e086f13a780853b775ef13426/frigate/detectors/plugins/memryx.py#L218-L254","documentation":"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__.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Re-zip the package ensuring it directly contains the .dfp file (correct extension) at some level inside the archive","If you only have an .onnx, compile it with MemryX tools (MIX/npu compiler) to produce a .dfp first","Verify archive contents: unzip -l model.zip should show a .dfp entry"],"exampleFix":"# verify contents before configuring\nunzip -l /models/custom.zip\n# must include e.g. yolov6s.dfp (and yolov6s_post.onnx if required)","handlingStrategy":"validation","validationCode":"import zipfile\n\ndef zip_has_dfp(path: str) -> bool:\n    with zipfile.ZipFile(path) as z:\n        return any(n.endswith('.dfp') for n in z.namelist())","typeGuard":null,"tryCatchPattern":"try:\n    detector = MemryXDetector(config)\nexcept FileNotFoundError as e:\n    if 'No .dfp file' in str(e):\n        raise SystemExit('Zip lacks a .dfp; recompile with MemryX tools') from None\n    raise","preventionTips":["Verify zip contents with unzip -l before deploying","Compile models to .dfp with MemryX MIX tools, do not ship raw onnx","Standardize a packaging script that always includes the .dfp"],"tags":["memryx","dfp","model-package","extraction"],"backgroundTag":"malformed-model-archive","analyzedSha":"ca18b8dc131ccb3e086f13a780853b775ef13426","analyzedAt":"2026-08-27T11:28:05.618Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}