# RuntimeError: XNNPACK delegate not loaded, falling back to default CPU backend

- **ID:** `tensorflow/tflite-delegate-not-loaded`
- **Domain:** tensorflow
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 82%

## 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).

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| tensorflow 2.10 | active | — | — |
| tensorflow 2.11 | active | — | — |
| tensorflow 2.12 | active | — | — |

## Workarounds

1. **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** (85% success)
   ```
   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
   ```
2. **Disable XNNPACK delegate and use default CPU backend explicitly: interpreter = tf.lite.Interpreter(model_path, experimental_delegates=[])** (95% success)
   ```
   Disable XNNPACK delegate and use default CPU backend explicitly: interpreter = tf.lite.Interpreter(model_path, experimental_delegates=[])
   ```

## Dead Ends

- **** — The environment variable only enables the delegate if the library can be found; it does not install or fix the library. (95% fail)
- **** — Older versions may not have XNNPACK support at all, or may have different delegate APIs. (70% fail)
