NobuoTsukamoto / meta-tensorflow-lite

Yocto layer for TensorFlow Lite interpreter with Python / C++.
MIT License
33 stars 18 forks source link

[kirkstone] Build python3-tensorflow-lite fails #30

Closed NobuoTsukamoto closed 2 years ago

NobuoTsukamoto commented 2 years ago

Environment

Procedure

$ git clone -b kirkstone git://git.yoctoproject.org/poky.git
$ git clone -b kirkstone git://git.yoctoproject.org/meta-raspberrypi
$ git clone -b kirkstone git://git.openembedded.org/meta-openembedded
$ git clone -b kirkstone_candidate https://github.com/NobuoTsukamoto/meta-tensorflow-lite.git

$ source poky/oe-init-build-env build
$ bitbake-layers add-layer ../meta-openembedded/meta-oe/
$ bitbake-layers add-layer ../meta-openembedded/meta-python/
$ bitbake-layers add-layer ../meta-openembedded/meta-networking/
$ bitbake-layers add-layer ../meta-openembedded/meta-multimedia/
$ bitbake-layers add-layer ../meta-raspberrypi/
$ bitbake-layers add-layer ../meta-tensorflow-lite/

$ MACHINE=raspberrypi4-64 bitbake python3-tensorflow-lite

Error

NobuoTsukamoto commented 2 years ago

I added the following to the recipe of python3-tensorflow-lite_2.8.0.bb, but I get the same error.

diff --git a/recipes-framework/tensorflow-lite/python3-tensorflow-lite_2.8.0.bb b/recipes-framework/tensorflow-lite/python3-tensorflow-lite_2.8.0.bb
index 7c8818d..01de067 100644
--- a/recipes-framework/tensorflow-lite/python3-tensorflow-lite_2.8.0.bb
+++ b/recipes-framework/tensorflow-lite/python3-tensorflow-lite_2.8.0.bb
@@ -67,6 +67,9 @@ HOST_ARCH:raspberrypi4-64 = "aarch64"
 TUNE_CCARGS:raspberrypi4-64 = ""
 EXTRA_OECMAKE:append:raspberrypi4-64 = "-DTFLITE_ENABLE_XNNPACK=ON"

+do_configure[network] = "1"
+do_compile[network] = "1"
+
 do_compile:prepend() {
     TENSORFLOW_VERSION=$(grep "_VERSION = " "${S}/tensorflow/tools/pip_package/setup.py" | cut -d= -f2 | sed "s/[ '-]//g")
     export PACKAGE_VERSION="${TENSORFLOW_VERSION}"
NobuoTsukamoto commented 2 years ago

This is because FETCHCONTENT_FULLY_DISCONNECTED is specified in the cmake option (set in cmake.bbclass).

I can download it by adding the following to the recipe of python3-tensorflow-lite_2.8.0.bb.

EXTRA_OECMAKE:append = "-DFETCHCONTENT_FULLY_DISCONNECTED=OFF "

However, a compile error occurred.

| In file included from /home/nobuo/Data/yocto/test/build/tmp/work/cortexa72-poky-linux/python3-tensorflow-lite/2.8.0-r0/git/tensorflow/lite/python/interpreter_wrapper/python_error_reporter.cc:16:
| /home/nobuo/Data/yocto/test/build/tmp/work/cortexa72-poky-linux/python3-tensorflow-lite/2.8.0-r0/git/tensorflow/lite/python/interpreter_wrapper/python_error_reporter.h:19:10: fatal error: Python.h: No such file or directory
|    19 | #include <Python.h>
|       |          ^~~~~~~~~~
| compilation terminated.
NobuoTsukamoto commented 2 years ago

However, a compile error occurred.

This is my mistake. Close this issue.