{"record":{"id":"cc3859f497dfc06a","repo":"blakeblackshear/frigate","slug":"model-does-not-support-detector-type-of-detector","errorCode":null,"errorMessage":"Model does not support detector type of {detector}","messagePattern":"Model does not support detector type of (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"frigate/detectors/detector_config.py","lineNumber":178,"sourceCode":"\n        # download the model if it doesn't exist\n        if not os.path.isfile(self.path):\n            download_url = plus_api.get_model_download_url(model_id)\n            r = requests.get(download_url)\n            with open(self.path, \"wb\") as f:\n                f.write(r.content)\n\n        # download the model info if it doesn't exist\n        if not os.path.isfile(model_info_path):\n            model_info = plus_api.get_model_info(model_id)\n            with open(model_info_path, \"w\") as f:\n                json.dump(model_info, f)\n        else:\n            with open(model_info_path) as f:\n                model_info: dict[str, Any] = json.load(f)\n\n        if detector and detector not in model_info[\"supportedDetectors\"]:\n            raise ValueError(f\"Model does not support detector type of {detector}\")\n\n        self.width = model_info[\"width\"]\n        self.height = model_info[\"height\"]\n        self.input_tensor = InputTensorEnum(model_info[\"inputShape\"])\n        self.input_pixel_format = PixelFormatEnum(model_info[\"pixelFormat\"])\n        self.model_type = ModelTypeEnum(model_info[\"type\"])\n\n        if model_info.get(\"inputDataType\"):\n            self.input_dtype = InputDTypeEnum(model_info[\"inputDataType\"])\n\n        # RKNN always uses NHWC\n        if detector == \"rknn\":\n            self.input_tensor = InputTensorEnum.nhwc\n\n        # generate list of attribute labels\n        self.attributes_map = {\n            **model_info.get(\"attributes\", DEFAULT_ATTRIBUTE_LABEL_MAP),\n            **self.attributes_map,","sourceCodeStart":160,"sourceCodeEnd":196,"githubUrl":"https://github.com/blakeblackshear/frigate/blob/ca18b8dc131ccb3e086f13a780853b775ef13426/frigate/detectors/detector_config.py#L160-L196","documentation":"The model's model_info.json declares a list of supportedDetectors and the configured detector type is not in it. Frigate stores per-model metadata when caching models; this check prevents feeding a model to a detector backend it was not converted for (e.g. an edgetpu .tflite passed to a CPU detector).","triggerScenarios":"Calling check_and_load_plus_model(detector=...) for a cached or downloaded model whose model_info.json 'supportedDetectors' list does not contain the given detector string (e.g. detector='onnx' but the model only lists 'edgetpu').","commonSituations":"User sets model path to a model file converted for a different backend; stale cached model_info.json in the model cache dir from a previous different model with the same filename; copy/paste detector config from docs for another detector type.","solutions":["Match the detector type to the model: use a model converted for the configured detector (e.g. an ONNX model for onnx detector, TFLite edgetpu model for edgetpu)","Clear the stale model cache directory so model_info.json is regenerated for the correct model","Provide your own model converted/exported for the intended detector backend and point model.path at it"],"exampleFix":"# before (edgetpu model with onnx detector)\ndetectors:\n  onnx:\n    type: onnx\n    model:\n      path: /models/yolov9c_edgetpu.tflite\n# after\ndetectors:\n  edgetpu:\n    type: edgetpu\n    model:\n      path: /models/yolov9c_edgetpu.tflite","handlingStrategy":"validation","validationCode":"import json\n\ndef model_supports(model_info_path: str, detector: str) -> bool:\n    with open(model_info_path) as f:\n        return detector in json.load(f).get('supportedDetectors', [])","typeGuard":null,"tryCatchPattern":"try:\n    model_config.check_and_load_plus_model(detector='onnx')\nexcept ValueError as e:\n    if 'does not support detector type' in str(e):\n        # pick a model converted for this backend\n        ...","preventionTips":["Always pair models with the detector backend they were converted for","Clear the model cache after swapping model files","Keep model_info.json alongside custom models and accurate"],"tags":["model-mismatch","detector","config","validation"],"backgroundTag":"model-backend-mismatch","analyzedSha":"ca18b8dc131ccb3e086f13a780853b775ef13426","analyzedAt":"2026-08-27T11:28:05.618Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}