Tensorflow lite select-tf-ops not working

Hello,
I’ve converted a tensorflow model to a tensorflow lite model and I’ve specified these supported operators:

converter.target_spec.supported_ops = [
    tf.lite.OpsSet.TFLITE_BUILTINS,
  tf.lite.OpsSet.SELECT_TF_OPS
]

I’m trying to use it on Unity but whenever I execute it, this error pops up.

I’ve read that in order to make this work I would have to rebuild the library but I’m having trouble with it. Is there any other way to fix this error?

Hi @lleirell

Please provide some info on how you are trying to use it? Are you adding a dependency somewhere for TensorFlow Lite Interpreter?
For example inside an android project the common case is to use:
implementation "org.tensorflow:tensorflow-lite:2.9.0"
and when you have special operators that the native library cannot support you have to add the dependency:
implementation 'org.tensorflow:tensorflow-lite-select-tf-ops:2.9.0'

So how are you importing the library?

Regards

Hi @George_Soloupis ,
Thanks for your response. I added the packages through the package manager in Unity. In the manifest.json file I have these two lines:

"dependencies": {
    ...
    "com.github.asus4.tflite": "2.10.0",
    "com.github.asus4.tflite.common": "2.10.0"
}

I tried to add a dependency related to select-tf-ops writing it in the manifest.json but it didn’t work.

HI @lleirell

I saw this issue. I think Unity does not natively support this and you should open an issue at the github repo to get some specific answers.

Regards

2 Likes

one other option is to try to change the model so you don’t need selected ops. I know this can be hard but it’s a possibility

Do you know which ops are you missing?

1 Like

Hi @lgusm ,
I don’t really know but I’m using the ssd_mobilenet_v1_fpn_640x640_coco17_tpu-8 model here