{"record":{"id":"1db2f164e582a021","repo":"blakeblackshear/frigate","slug":"no-post-onnx-file-found-in-custom-model-zip-for","errorCode":null,"errorMessage":"No *_post.onnx file found in custom model zip for {self.memx_model_type.name}.","messagePattern":"No \\*_post\\.onnx file found in custom model zip for (.+?)\\.","errorType":"exception","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"frigate/detectors/plugins/memryx.py","lineNumber":248,"sourceCode":"                )\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,\n                ]:\n                    # Explicitly ignore any post model even if present\n                    self.memx_post_model = None\n                else:\n                    # Future model types can optionally use post if present\n                    self.memx_post_model = (\n                        post_candidates[0] if post_candidates else None\n                    )\n\n                logger.info(f\"Using custom model: {self.memx_model_path}\")\n                return\n","sourceCodeStart":230,"sourceCodeEnd":266,"githubUrl":"https://github.com/blakeblackshear/frigate/blob/ca18b8dc131ccb3e086f13a780853b775ef13426/frigate/detectors/plugins/memryx.py#L230-L266","documentation":"For model types yolonas and ssd, the MemryX post-processing runs on-device via a *_post.onnx companion model; if the extracted custom zip contains no file matching *_post.onnx, the plugin cannot set up post-processing and raises FileNotFoundError.","triggerScenarios":"Custom zip with model type yolonas or ssd where glob for **/*_post.onnx in the extraction dir returns empty, e.g. the user only packaged the .dfp and omitted the post-processing onnx.","commonSituations":"Compiling a YOLO-NAS/SSD model with MIX and forgetting to include the generated *_post.onnx; renaming the post model; using a zip built for a different model type.","solutions":["Re-create the zip including the *_post.onnx alongside the .dfp (name must match the *_post.onnx pattern)","Or switch to a model type that does not need a post model (e.g. yolox/yologeneric handle post-processing on host)","Regenerate the package with the MemryX export flow so both artifacts are included"],"exampleFix":"# zip layout for yolonas\nunzip -l custom.zip\n# yolonas.dfp\n# yolonas_post.onnx  <- required","handlingStrategy":"validation","validationCode":"import zipfile\n\ndef zip_has_post_onnx(path: str) -> bool:\n    with zipfile.ZipFile(path) as z:\n        return any(n.endswith('_post.onnx') for n in z.namelist())","typeGuard":null,"tryCatchPattern":"try:\n    detector = MemryXDetector(config)\nexcept FileNotFoundError as e:\n    if '_post.onnx' in str(e):\n        raise SystemExit('Add the *_post.onnx to the model zip for yolonas/ssd') from None\n    raise","preventionTips":["For yolonas/ssd always export with the on-device post model and zip it together","Name post models with the *_post.onnx suffix","Validate archive contents in a deploy script"],"tags":["memryx","post-model","onnx","model-package"],"backgroundTag":"malformed-model-archive","analyzedSha":"ca18b8dc131ccb3e086f13a780853b775ef13426","analyzedAt":"2026-08-27T11:28:05.618Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}