Tensorflow Lite - Flatbuffers.h error [Bitbake cmake]

cancel
Showing results for 
Search instead for 
Did you mean: 

Tensorflow Lite - Flatbuffers.h error [Bitbake cmake]

1,563 Views
ardtrkc
Contributor II

Hello !

Our aim is to install TensorFlow Lite in our embedded board. To reach this aim, firstly we made a recipe to build TFLite in our Yocto framework. After this step our static tensorflow-lite library was generated.

Then, we wanted to try the functionality of the library with a basic helloworld program. For this step, we chose to start with minimal.cpp which is from official github repo of tensorflow.

For this helloworld (minimal.cpp) program we created a recipe which includes our static tensorflow-lite library inside DEPENDS part. When we bitbake with cmake recipe we get this error about flatbuffers.h ;

 

/home/student/fsl-release-bsp/build-analytics-tflite/tmp/sysroots/analytics/usr/include/tensorflow/contrib/lite/schema/schema_generated.h:21:37: fatal error: flatbuffers/flatbuffers.h: No such file or directory
|  #include "flatbuffers/flatbuffers.h"

 

     -Please check below for files-

  • #include part of minimal.cpp :

 

#include <cstdio>
#include "tensorflow/lite/interpreter.h"
#include "tensorflow/lite/kernels/register.h"
#include "tensorflow/lite/model.h"
#include "tensorflow/lite/optional_debug_tools.h"

 

  • Our recipe (helloworld.bb) is as follows:

 

# Recipe for the Hello World program

SUMMARY = "Recipe for the Hello World program"
LICENSE = "CLOSED"
LIC_FILES_CHKSUM = ""

DEPENDS += "opencv"
DEPENDS += "libconfig"
DEPENDS += "tensorflow-lite"

SRC_URI = "git://github.com/aniladar/patch.git;protocol=https;branch=main"

SRCREV = "${AUTOREV}"

# Here we specify the source directory, where we do all the building and expect sources to be placed
S = "${WORKDIR}/git"
B = "${S}"
inherit cmake

 

  • The CMakeLists.txt file is as follows:

 

cmake_minimum_required(VERSION 3.14)

project(patch)

add_executable(minimal minimal.cc)

 

Maybe we need some additional things inside CMakeLists.txt file or maybe we have missing DEPENDS inside our recipe. If you brighten up our path it would be perfect. Your guidance and clarifications are important for us.

Thank you in advance !

 

Labels (3)
0 Kudos
1 Reply

1,533 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello ardtrkc,

For Tensorflow issue once can see the eIQ Machine learning page:

https://community.nxp.com/t5/eIQ-Machine-Learning-Software/tkb-p/eiq@tkb

There is a lot of example where tensor flow is relases:

https://community.nxp.com/t5/eIQ-Machine-Learning-Software/eIQ-Sample-Apps-Overview/ta-p/1122925

 

Regards

 

0 Kudos