Taken from: https://www.tensorflow.org/lite/guide/build_cmake_pip
NOTE: See tflite_micro_runtime which runs 8x faster on the RPI0.
See https://docs.docker.com/docker-for-windows/wsl/
# From Linux terminal (or WSL)
git clone --branch v2.5.0 https://github.com/tensorflow/tensorflow.git
cd tensorflow
sudo ./tensorflow/tools/ci_build/ci_build.sh PI-PYTHON37 tensorflow/lite/tools/pip_package/build_pip_package_with_cmake.sh rpi0
After the above commands run, the built wheel should be found at (in your Linux or WSL terminal):
./tensorflow/lite/tools/pip_package/gen/tflite_pip/python3.7/dist/
To install, issue the following command on your RPI
sudo pip3 install https://github.com/driedler/tflite_runtime_rpi0w/releases/download/2.5.0/tflite_runtime-2.5.0-cp37-cp37m-linux_armv6l.whl