{
  "id": "opencv/dnn-readnet-from-onnx-unsupported-op",
  "signature": "cv2.error: OpenCV(4.9.0) ../modules/dnn/src/onnx/onnx_importer.cpp:1122: error: (-2:Unspecified error) in function 'importNode': OpenCV does not support ONNX operator 'ScatterND'",
  "signature_zh": "cv2.error: OpenCV(4.9.0) ../modules/dnn/src/onnx/onnx_importer.cpp:1122: 错误: (-2:未指定错误) 函数 'importNode': OpenCV 不支持 ONNX 算子 'ScatterND'",
  "regex": "OpenCV does not support ONNX operator '[A-Za-z]+'",
  "domain": "opencv",
  "category": "module_error",
  "subcategory": null,
  "root_cause": "The ONNX model uses an operator (e.g., ScatterND, NonMaxSuppression) that is not implemented in OpenCV's DNN module.",
  "root_cause_type": "generic",
  "root_cause_zh": "ONNX 模型使用了 OpenCV DNN 模块未实现的算子（例如 ScatterND, NonMaxSuppression）。",
  "versions": [
    {
      "version": "4.8.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "4.9.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "4.10.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "OpenCV's DNN backend has limited ONNX operator coverage; many ops remain unimplemented across versions.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Conversion tools often map unsupported ops to other unsupported ops or fail entirely.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Export the ONNX model from PyTorch/TensorFlow with opset version 10 or lower, avoiding newer operators: torch.onnx.export(model, dummy_input, 'model.onnx', opset_version=10)",
      "success_rate": 0.7,
      "how": "Export the ONNX model from PyTorch/TensorFlow with opset version 10 or lower, avoiding newer operators: torch.onnx.export(model, dummy_input, 'model.onnx', opset_version=10)",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use a different inference backend like ONNX Runtime instead of OpenCV DNN: import onnxruntime; session = onnxruntime.InferenceSession('model.onnx')",
      "success_rate": 0.95,
      "how": "Use a different inference backend like ONNX Runtime instead of OpenCV DNN: import onnxruntime; session = onnxruntime.InferenceSession('model.onnx')",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Export the ONNX model from PyTorch/TensorFlow with opset version 10 or lower, avoiding newer operators: torch.onnx.export(model, dummy_input, 'model.onnx', opset_version=10)",
    "Use a different inference backend like ONNX Runtime instead of OpenCV DNN: import onnxruntime; session = onnxruntime.InferenceSession('model.onnx')"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://docs.opencv.org/4.x/d6/d0f/group__dnn.html",
  "official_doc_section": null,
  "error_code": "-2",
  "verification_tier": "ai_generated",
  "confidence": 0.87,
  "fix_success_rate": 0.8,
  "resolvable": "partial",
  "first_seen": "2024-01-15",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}