tensorflow / tensorflow/tflite-support

Android NDK Prefabs for Tensorflow Lite

Open
#940 0 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

Hey all! I'm trying to use Tensorflow Lite in an Android NDK/C++ environment.

My build.gradle looks something like this:

...
android {
  ...
  buildFeatures {
    prefab true
  }
}

dependencies {
  ...
  implementation "org.tensorflow:tensorflow-lite:2.13.0"
}

And in my CMakeLists.txt I try to find tensorflow-lite as a prefab:

...
find_package(tensorflow-lite REQUIRED CONFIG)
...

target_link_libraries(
  ${PACKAGE_NAME}
  ...
  tensorflow-lite::tensorflow-lite
)

However, CMake is not able to find the package:

CMake Error at CMakeLists.txt:10 (find_package):
  Could not find a package configuration file provided by "tensorflow-lite"
  with any of the following names:

    tensorflow-liteConfig.cmake
    tensorflow-lite-config.cmake

  Add the installation prefix of "tensorflow-lite" to CMAKE_PREFIX_PATH or
  set "tensorflow-lite_DIR" to a directory containing one of the above files.
  If "tensorflow-lite" provides a separate development package or SDK, be
  sure it has been installed.

Does TensorFlow Lite not provide a prefab publish? This would make it a lot easier to integrate in such environments. Now I have to manually extract the .aar/zip and incldue the headers.

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 with the build.gradle dependency and the CMakeLists.txt find_package(tensorflow-lite) entry point described in the issue, then inspect how the tensorflow-lite:2.13.0 artifact is packaged. Done should mean Android NDK projects can enable Prefab and resolve tensorflow-lite through CMake without manually extracting the AAR.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, cmake, cpp
Domain
build-system, mobile-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.