{
  "id": "tensorflow/tflite-delegate-not-loaded",
  "signature": "RuntimeError: XNNPACK delegate not loaded, falling back to default CPU backend",
  "signature_zh": "RuntimeError: XNNPACK 委托未加载，回退到默认 CPU 后端",
  "regex": "RuntimeError: XNNPACK delegate not loaded, falling back to default CPU backend",
  "domain": "tensorflow",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "TFLite interpreter fails to load the XNNPACK delegate, often due to missing or incompatible shared library (libXNNPACK.so) or architecture mismatch (e.g., ARM vs x86).",
  "root_cause_type": "generic",
  "root_cause_zh": "TFLite 解释器无法加载 XNNPACK 委托，通常是由于缺少或不兼容的共享库（libXNNPACK.so）或架构不匹配（例如 ARM 与 x86）。",
  "versions": [
    {
      "version": "tensorflow 2.10",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "tensorflow 2.11",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "tensorflow 2.12",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "The environment variable only enables the delegate if the library can be found; it does not install or fix the library.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Older versions may not have XNNPACK support at all, or may have different delegate APIs.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Install the XNNPACK delegate manually: pip install tflite-runtime and ensure libXNNPACK.so is in LD_LIBRARY_PATH. Alternatively, rebuild TensorFlow Lite with XNNPACK enabled using the build script: bazel build --define xnnpack_support=true //tensorflow/lite/delegates/xnnpack:xnnpack_delegate",
      "success_rate": 0.85,
      "how": "Install the XNNPACK delegate manually: pip install tflite-runtime and ensure libXNNPACK.so is in LD_LIBRARY_PATH. Alternatively, rebuild TensorFlow Lite with XNNPACK enabled using the build script: bazel build --define xnnpack_support=true //tensorflow/lite/delegates/xnnpack:xnnpack_delegate",
      "condition": "",
      "sources": []
    },
    {
      "action": "Disable XNNPACK delegate and use default CPU backend explicitly: interpreter = tf.lite.Interpreter(model_path, experimental_delegates=[])",
      "success_rate": 0.95,
      "how": "Disable XNNPACK delegate and use default CPU backend explicitly: interpreter = tf.lite.Interpreter(model_path, experimental_delegates=[])",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "手动安装 XNNPACK 委托：pip install tflite-runtime 并确保 libXNNPACK.so 在 LD_LIBRARY_PATH 中。或者，使用构建脚本重新编译支持 XNNPACK 的 TensorFlow Lite：bazel build --define xnnpack_support=true //tensorflow/lite/delegates/xnnpack:xnnpack_delegate",
    "显式禁用 XNNPACK 委托并使用默认 CPU 后端：interpreter = tf.lite.Interpreter(model_path, experimental_delegates=[])"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://www.tensorflow.org/lite/performance/xnnpack",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.86,
  "fix_success_rate": 0.82,
  "resolvable": "partial",
  "first_seen": "2023-08-20",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}