tensorflow / tensorflow/tflite-support

Tflite training failed in Android

Open
#934 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
441
Forks
146
PR merge metrics
No merged PRs in 30d

Description

Hello All,

I am using C++ with JNI to use C++/tflite on Android.

I am getting below error while invoking tflite method encode_runner->Invoke().

Select TensorFlow op(s), included in the given model, is(are) not supported by this interpreter. Make sure you apply/link the Flex delegate before inference. For the Android, it can be resolved by adding "org.tensorflow:tensorflow-lite-select-tf-ops" dependency. See instructions: https://www.tensorflow.org/lite/guide/ops_select

I have built libtensorflowlite.so for 2 targets using below command.
bazel build --config=android_arm64 -c opt //tensorflow/lite:libtensorflowlite.so
bazel build --config=android_x86_64 -c opt //tensorflow/lite:libtensorflowlite.so

I have built libtensorflowlite_flex.so for 2 targets using below command.
bazel build -c opt --config=android_x86_64 --config=monolithic --define=tflite_convert_with_select_tf_ops=true --define=with_select_tf_ops=true //tensorflow/lite/delegates/flex:libtensorflowlite_flex.so
bazel build -c opt --config=android_arm64 --config=monolithic --define=tflite_convert_with_select_tf_ops=true --define=with_select_tf_ops=true //tensorflow/lite/delegates/flex:libtensorflowlite_flex.so

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the encode_runner->Invoke() entry point and review the Android build commands for libtensorflowlite.so and libtensorflowlite_flex.so. Compare the integration with the Select TF Ops instructions linked in the issue, then verify that invoking the model no longer reports unsupported TensorFlow operations.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, cpp
Domain
machine-learning, mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.