Building TensorFlow Lite Support Library with Docker

First install Docker

Collect neccessary files and start a container

docker build . -t tf-support-builder -f tflite-android.Dockerfile
docker run -it -v pwd:/host_dir tf-support-builder bash

Download the tensorflow_lite_support folder

Import the script files and tensorflow_lite_support folder at specific locations inside Docker container

docker container ls --all 
docker cp build_support_aar.sh d40836790a39:/tensorflow_src/tensorflow/lite/tools/
docker cp tensorflow_lite_support d40836790a39:/tensorflow_src
docker cp build_support_aar_with_docker.sh d40836790a39:/

Go back at the first Power Shell window and execute linux commands

ls
chmod +x build_support_aar_with_docker.sh
sudo ln -sf /usr/bin/python3 /usr/bin/python
./build_support_aar_with_docker.sh 

Move generated folder from container back to Windows folder

docker cp d40836790a39:tensorflow_src/bazel-bin/tensorflow_lite_support tensorflow-lite-support

Use the final .aar file inside Android Studio

Colab Notebook

Conclusion

--

--

--

I am a pharmacist turned android developer and machine learning engineer. Right now I’m a senior android developer at Invisalign and a ML GDE.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Difference between Hard link and Symbolic link

Get your medium stories’ stats from command line in JSON format

Create NFT Art With Artificial Intelligence Using Python

Review of the competitor Crodo — Fantom Pad Hello friends!

Go Generics In 5 Minutes Or Less

How to fix the error of guru meditation in Valorant

Small Businesses Hit the Jackpot with iOS Development

On the delivery of AI to Business

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
George Soloupis

George Soloupis

I am a pharmacist turned android developer and machine learning engineer. Right now I’m a senior android developer at Invisalign and a ML GDE.

More from Medium

Face processing in training and face recognition

Building an android application to control Tello drone flight and perform real-time object…

VITTY — From an Idea to a Reality

Build monitoring system — part 1