TFLITE_FLEX_MISSING tensorflow build_error ai_generated true

RuntimeError: TFLite interpreter failed to create: Could not find the Flex delegate. Ensure the TensorFlow Lite Flex delegate is linked.

ID: tensorflow/tflite-flex-delegate-not-found

Also available as: JSON · Markdown · 中文
78%Fix Rate
84%Confidence
1Evidence
2024-04-12First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
tensorflow==2.16.1 active
tflite-runtime==2.16.0 active

Root Cause

The TFLite model uses TensorFlow ops that require the Flex delegate, but the interpreter was built without Flex support or the delegate library is not loaded.

generic

中文

TFLite 模型使用了需要 Flex 委托的 TensorFlow 算子,但解释器构建时未包含 Flex 支持或未加载委托库。

Official Documentation

https://www.tensorflow.org/lite/guide/ops_select

Workarounds

  1. 85% success Install the full TensorFlow package which includes the Flex delegate, or build TFLite with Flex support enabled.
    Install the full TensorFlow package which includes the Flex delegate, or build TFLite with Flex support enabled.
  2. 75% success Convert the TFLite model without TensorFlow ops by replacing them with native TFLite ops before conversion.
    Convert the TFLite model without TensorFlow ops by replacing them with native TFLite ops before conversion.

中文步骤

  1. Install the full TensorFlow package which includes the Flex delegate, or build TFLite with Flex support enabled.
  2. Convert the TFLite model without TensorFlow ops by replacing them with native TFLite ops before conversion.

Dead Ends

Common approaches that don't work:

  1. 85% fail

    Installing tflite-runtime without the Flex delegate package (tflite-support) does not resolve the missing delegate.

  2. 70% fail

    Enabling XNNPACK delegate only accelerates certain ops but does not provide Flex support for TensorFlow ops.