Recently, Google officially released the TensorFlow Lite Developer Preview, a lightweight solution for mobile and embedded devices. TensorFlow Lite is a new design with three important features-lightweight (lightweight), Cross-platform (Cross-platform), and fast (fast).
Today, we officially release the TensorFlow Lite developer Preview, a lightweight solution for mobile and embedded devices. TensorFlow can run on many platforms, from a large number of servers on a rack to a small iot of things, but in recent years, with the exponential growth of the machine learning model used by everyone, the platform of the training model needs to be extended to mobile and embedded devices. TensorFlow Lite supports low time delay reasoning for machine learning models on devices.
TensorFlow Lite is a new design that supports the following features:
Magnitude (lightweight): The reasoning behind the machine learning model is performed in a smaller binary number and can be initialized/started quickly.
Cross-platform (cross-platform): Can run on many different platforms and now support Android and IOS
Quick (FAST): Optimized for mobile devices, including significantly reduced model load times and support for hardware acceleration.
Today, more and more mobile devices contain dedicated custom hardware to make machine learning more efficient. TensorFlow Lite supports the Android Neural network API (the Android Neural Networks API), and you can use these useful accelerators when using TensorFlow Lite.
When the accelerator (Hardware device) is unavailable, the TensorFlow Lite is returned to the CPU for execution, which ensures that the model can still be run quickly on a large number of devices.
The following figure is the structural design of the TensorFlow Lite:
The modules are as follows:
TensorFlow Model: TensorFlow models that have been trained for storage on hard drives
TensorFlow Lite Converter: A program that converts a model to a TensorFlow Lite file format.
TensorFlow Lite model file: Based on the flatbuffers format, the speed and size are optimized.
You can deploy TensorFlow Lite Model File to Mobile App, as shown in the figure above:
Java API: In the Android app C + + app, easy to package.
C + + API: Load TensorFlow Lite Model File, invoke interpreter (interpreter).
Both of these libraries are available on both the Android and IOS side.
Interpreter: Use a set of operators to perform the model. Operators can be selected, if the operator is not included, only 70KB, after all operators are loaded 300KB. TensorFlow Mobile, which requires 1.5 M (using a regular set of operators), can significantly reduce capacity.
On Android devices, interpreter supports the Android Neural network API, which can be used for hardware acceleration. If no accelerators are available, the CPU is used by default.
Developers can also use C + + APIs to customize kernel.
As you know, TensorFlow can move and embed the model through the TensorFlow mobile API. Looking ahead, TensorFlow Lite should be seen as an upgrade of TensorFlow Mobile. As a step-by-step maturity, it will be a recommended solution for deploying models on mobile and embedded devices.