Skip to content

Bitbaking tensorflow-lite fails with, Error: 'IsOutRange' is not a member of 'flatbuffers' #76

@octonout

Description

@octonout

Issue Description

I am trying to add tensorflow-lite to my Boot2Qt image for Jetson Nano.
My Yocto Release version is dunfell.

bitbake tensorflow-lite command builds the meta-neural-network/recipes-tensorflow/tensorflow-lite/tensorflow-lite_2.3.bb recipe. The recipe does not assign anything to SRCREV for git://github.com/tensorflow/tensorflow;destsuffix=git/;branch=r2.3;protocol=https in the SRC_URI. So, I created the following .bbappend.

unset SRC_URI
SRC_URI = " \
	git://github.com/tensorflow/tensorflow;destsuffix=git/;branch=r2.3;rev=v2.3.0;protocol=https \
	git://gitlab.com/libeigen/eigen.git;destsuffix=eigen/;branch=master;rev=cdb377d0cba4889fc909d1bbdd430b988db0db97;protocol=https \
	git://github.com/google/gemmlowp;destsuffix=gemmlowp/;branch=master;rev=2483d846ad865dd4190fe4a1a1ba2d9cfcea78e1;protocol=https \
	git://github.com/google/googletest;destsuffix=googletest/;branch=master;rev=release-1.10.0;protocol=https \
	git://github.com/abseil/abseil-cpp;destsuffix=abseil-cpp/;branch=master;rev=20190808;nobranch=1;protocol=https \
	git://github.com/intel/ARM_NEON_2_x86_SSE;destsuffix=neon_2_sse/;branch=master;rev=8dbe2461c89760ac4b204aa0eafb72413a97957d;protocol=https \
	git://github.com/google/farmhash;destsuffix=farmhash/;branch=master;rev=0d859a811870d10f53a594927d0d0b97573ad06d;protocol=https \
	git://github.com/google/flatbuffers;destsuffix=flatbuffers/;branch=master;rev=v1.11.0;protocol=https \
	https://mirror.bazel.build/www.kurims.kyoto-u.ac.jp/~ooura/fft.tgz;md5sum=${MD5SUM_FFT};sha256sum=${SHA256SUM_FFT} \
	file://apply-modification-for-tflite-1.15-to-eigen.patch \
	file://tensorflow-lite.pc.in \
"

In the .bbappend, I have set rev=v2.3.0 for the tensorflow repo. On running the bitbake tensorflow-lite do_compile task fails with the following error:

In file included from ./tensorflow/lite/core/api/op_resolver.h:20,
                 from ./tensorflow/lite/model_builder.h:27,
                 from ./tensorflow/lite/model.h:22,
                 from ./tensorflow/lite/c/c_api_internal.h:25,
                 from tensorflow/lite/c/c_api_experimental.cc:24:
./tensorflow/lite/schema/schema_generated.h: In function 'const char* tflite::EnumNameTensorType(tflite::TensorType)':
./tensorflow/lite/schema/schema_generated.h:422:20: error: 'IsOutRange' is not a member of 'flatbuffers'

The above error is followed by the same error on many lines in the schema_generated.h where IsOutRange is used. I have pasted a link to the log file at the bottom of the post.

While looking for a solution I came across this issue on tensorflow repo. In that issue it seems the reason behind the error was IsOutRange not being available in flatbuffers v1.11.0. They seem to have solved the issue by using flatbuffers v1.12.0 as can be seen in this commit which edits the third_party_downloads.inc file.

The ${BUILDDIR}/tmp/work/aarch64-poky-linux/tensorflow-lite/2.3-r0/git/tensorflow/lite/micro/tools/make/third_party_downloads.inc file has the following contents.
FLATBUFFERS_URL is being set like so via the statement defined in else:
FLATBUFFERS_URL := "https://github.com/google/flatbuffers/archive/v1.12.0.tar.gz"

I cannot figure out why the do_compile task throws this error. I will appreciate any help.

Update 1:
${BUILDDIR}/build-jetson-nano-qspi-sd/tmp/work/aarch64-poky-linux/tensorflow-lite/2.3-r0/flatbuffers/src/flatc.cpp has the following line: #define FLATC_VERSION "1.11.0" So the 1.11.0 version of flatbuffers is being downloaded?

Update 2:
Changed the rev for flatbuffers in SRC_URI to git://github.com/google/flatbuffers;destsuffix=flatbuffers/;branch=master;rev=v1.12.0;protocol=https and now the build fails with the following error.

Expected Result

The tensorflow-lite package should get built.

How to Reproduce

As described in the issue description.

Further Information

  • A link to an output result showing the issue: log file
  • Exact OS version: Host for Yocto: Ubuntu 20.04. Yocto Release: dunfell.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions