Generate the build dependencies for TensorFlow Lite

FlatBuffers is another efficient, cross-platform, serialization library for C++. Google developed FlatBuffers for performance-critical applications. Flatbuffers generate TensorFlow Lite files to serialize their model data. As a result, Arm NN must use FlatBuffers to load and interpret the TensorFlow Lite files.

You require the FlatBuffers library for the Arm NN TensorFlow Lite parsers. To build the FlatBuffers library, use the instructions found in the FlatBuffers Building Guide.

The following example code shows you how you can build the FlatBuffers library and interpret the TensorFlow Lite format:

  1. Use the following example code to build the FlatBuffers library:
    $ cd $BASEDIR/flatbuffers-1.12.0
    $ mkdir build
    $ cd build
    $ CXXFLAGS="-fPIC" cmake .. -DFLATBUFFERS_BUILD_FLATC=1 -DCMAKE_INSTALL_PREFIX:PATH=$BASEDIR/flatbuffers
    
    $ make
  2. Use the following example code to interpret the TensorFlow Lite format:
    $ mkdir tflite
    $ cd tflite
    $ cp $BASEDIR/tensorflow/tensorflow/lite/schema/schema.fbs .
    $ $BASEDIR/flatbuffers-1.12.0/build/flatc -c --gen-object-api --reflect-types --reflect-names schema.fbsS
Previous Next