Closed vivien closed 11 months ago
As of 76263ba, libcamera-apps builds for raspberrypi3 and raspberrypi4, but tensorflow-lite fails for raspberrypi with:
Linking tensorflow/lite/libtensorflowlite.so failed: (Exit 1): arm-poky-linux-gnueabi-gcc failed: error executing command
Even though libcamera-apps now sets the dependency correctly with:
PACKAGECONFIG[tflite] = "-Denable_tflite=true, -Denable_tflite=false, tensorflow-lite"
the configure stage for raspberrypi4 ends up with:
Run-time dependency tensorflow-lite found: NO (tried pkgconfig and cmake)
...
Build configuration
...
TFLite postprocessing: NO
...
User defined options
...
enable_tflite : true
Any idea why the libcamera-apps recipe doesn't detect the tensorflow-lite library?
Run-time dependency tensorflow-lite found: NO (tried pkgconfig and cmake)
there will be some .txt files for errors generated by cmake in builddir. So please share those.
The package is now using meson instead of cmake. Here's the related snippet from /build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/libcamera-apps/1.2.1+gitAUTOINC+1c1d1c1a2a-r0/build/meson-logs/meson-log.txt
:
Determining dependency 'tensorflow-lite' with pkg-config executable '/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/libcamera-apps/1.2.1+gitAUTOINC+1c1d1c1a2a-r0/recipe-sysroot-native/usr/bin/pkg-config'
env[PKG_CONFIG_DISABLE_UNINSTALLED]: yes
env[PKG_CONFIG_SYSTEM_LIBRARY_PATH]: /lib:/usr/lib
env[PKG_CONFIG_PATH]: /build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/libcamera-apps/1.2.1+gitAUTOINC+1c1d1c1a2a-r0/recipe-sysroot/usr/lib/pkgconfig:/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/libcamera-apps/1.2.1+gitAUTOINC+1c1d1c1a2a-r0/recipe-sysroot/usr/share/pkgconfig
env[PKG_CONFIG_DIR]: /build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/libcamera-apps/1.2.1+gitAUTOINC+1c1d1c1a2a-r0/recipe-sysroot/usr/lib/pkgconfig
env[PKG_CONFIG_SYSROOT_DIR]: /build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/libcamera-apps/1.2.1+gitAUTOINC+1c1d1c1a2a-r0/recipe-sysroot
env[PKG_CONFIG_LIBDIR]: /build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/libcamera-apps/1.2.1+gitAUTOINC+1c1d1c1a2a-r0/recipe-sysroot/usr/lib/pkgconfig
env[PKG_CONFIG_SYSTEM_INCLUDE_PATH]: /usr/include
Called `/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/libcamera-apps/1.2.1+gitAUTOINC+1c1d1c1a2a-r0/recipe-sysroot-native/usr/bin/pkg-config --modversion tensorflow-lite` -> 1
stderr:
Package tensorflow-lite was not found in the pkg-config search path.
Perhaps you should add the directory containing `tensorflow-lite.pc'
to the PKG_CONFIG_PATH environment variable
No package 'tensorflow-lite' found
Adding inherit pkgconfig
to the tensorflow-lite recipe results in the same error.
you might want to look at tensorflow-lite recipe and see why it is not generating and/or packaging the .pc file
So tensorflow-lite from meta-tensorflow is not installing any tensorflow-lite.pc file, it isn't installing the header files neither. While this can be fixed, it doesn't provide the missing flatbuffers files too. I switched to tensorflow-lite from meta-neural-network, which works with a few fixups. I now have libcamera-detect on raspberrypi4-64.
interesting, I dont know which layer should be considered more official some indicators I use is activity and on that meta-tensorflow is on https://git.yoctoproject.org/meta-tensorflow so it should be the one people usually will default to and therefore should be fixed. I would suggest to inform the meta-tensorflow maintainers about this issue. meta-neural-network is for NNstreamer and they might maintain tensorflow-lite in a narrow sense of just NNstreamer which makes sense for what the layer is about.
btw. there is https://github.com/NobuoTsukamoto/meta-tensorflow-lite as well so you have choices like in a fish market :)
So this doesn't look RPi-specific, does it?
Indeed, these are issues in meta-tensorflow and compilation issue on 32-bit ARM. I'm closing this issue for now but I'll push a few tweaks for libcamera-detect integration soon though.
With the meta-tensorflow layer added to bblayers, enabling TFLITE in the libcamera-apps build will result in:
This happens regardless of having tensorflow-lite listed as a build dependency or not, as fixed by 2cdb97a.