Skip to content

Selective builds to reduce tensorflow-lite binary size missing needed java package org.tensorflow.lite #45488

@duudat

Description

@duudat

Please make sure that this is a build/installation issue. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:build_template

System information
Try to build a custom .aar file from https://raw.githubusercontent.com/tensorflow/tensorflow/master/tensorflow/lite/tools/build_aar_with_docker.sh

Describe the problem
The result aar.file missing all java-wrapper classes (Interpreter, etc) under package: org.tensorflow.lite. These classes are needed to perform inference from a model in Android.

Provide the exact sequence of commands / steps that you executed before running into the problem
Following the instruction building selective build for a given tflite model using docker: https://www.tensorflow.org/lite/guide/reduce_binary_size#selectively_build_tensorflow_lite_with_docker

curl -o build_aar_with_docker.sh \
  https://raw.githubusercontent.com/tensorflow/tensorflow/master/tensorflow/lite/tools/build_aar_with_docker.sh &&
chmod +x build_aar_with_docker.sh

and

sh tensorflow/lite/tools/build_aar.sh \
  --input_models=/a/b/my_model.tflite \
  --target_archs=x86,x86_64,arm64-v8a,armeabi-v7a \
  --checkpoint=master \

Any other info/ logs
Rename resulted aar files to .zip and attached:

  1. aar file built from Mobilenet_1.0_224(float) model: tensorflow-lite-with-mobile-net-model.zip
  2. aar file built from my custom model: tflite-with-my-custom-model.zip

Both missing java classes

Note: did try to copy needed java classes into the resulted_aar but this approach seems not working. Might-be the generated .so files missing C++ files which support org.tensorflow.lite java classes as well.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions