Search code examples
androidandroid-ndktensorflowdeep-learningbazel

Compiling Android example for Tensorflow


In the official example for using Tensorflow models in an Android app : github link they mention changing entries in <workspace_root>/WORKSPACE.

I don't know which file this is and where to find it. I am used to developing Android app on Android studio and have never worked with workspace in Android before.

Please tell me which exact file they mean when they say :

The Android entries in <workspace_root>/WORKSPACE must be uncommented with the paths filled in appropriately depending on where you installed the NDK and SDK.

and where to find it!


Solution

  • WORSPACE is a file for Bazel. It is a text file in the home of the TensorFlow source repository. That file does contain a section at the top, currently:

    # Uncomment and update the paths in these entries to build the Android demo.
    #android_sdk_repository(
    #    name = "androidsdk",
    #    api_level = 23,
    #    build_tools_version = "23.0.1",
    #    # Replace with path to Android SDK on your system
    #    path = "<PATH_TO_SDK>",
    #)
    #
    #android_ndk_repository(
    #    name="androidndk",
    #    path="<PATH_TO_NDK>",
    #    api_level=21)