Get Select TF ops error when use TFlite to CV2 video detect on PI

When I use tflite to detect,it gets error: select tensorflow op(s),included in the given model,is not supported by this interpreter.
how can I solve it.I used TF2 to train and transfer to tflite,and call on pi.
Addtionally,How to avoid select tensorflow op when training pb model.

@Jie_Wade,

Welcome to the Tensorflow Forum!

If you’re using Bazel or CMake to build TensorFlow Lite interpreter, you can enable Flex delegate by linking a TensorFlow Lite Flex delegate shared library. You can build it with Bazel as the following command.

bazel build -c opt --config=monolithic tensorflow/lite/delegates/flex:tensorflowlite_flex

This command generates the following shared library in bazel-bin/tensorflow/lite/delegates/flex.

Platform Library name
Linux libtensorflowlite_flex.so

Note that the necessary TfLiteDelegate will be installed automatically when creating the interpreter at runtime as long as the shared library is linked. It is not necessary to explicitly install the delegate instance as is typically required with other delegate types.

Python

TensorFlow Lite with select TensorFlow ops will be installed automatically with the TensorFlow pip package. You can also choose to only install the TensorFlow Lite Interpreter pip package.

Addtionally,How to avoid select tensorflow op when training pb model

We can’t avoid the select tensorflow ops if there is no corresponding tflite built-in ops for the same.

Thank you!

Thank you ,but I’m not familiar with Bazel, let me try it.
For I have a tflite from others,it works well,but when I use mine,it get above error.If there are some customer exist tflite model to download except pretrained model