Error running example "Deploy Semantic Segmentation Application Using TensorFlow Lite..."

27 Ansichten (letzte 30 Tage)
Hi,
I am trying to run the MATLAB example "Deploy Semantic Segmentation Application Using TensorFlow Lite" but encountered errors. The example was opened by
openExample('deeplearning_shared/SemanticSegmentationUsingTFLiteModelOnHostAndRasPiExample')
I am using a Raspberry pi 4b, flashed with image mathworks_raspbian_DL_R22.2.0. Everything worked fine (the MEX file was generated on the host computer, and Raspberry pi was connected successfully) until code line 28, when attempting to generate a PIL MEX function:
codegen -config cfg tflite_semantic_predict -args ones(257,257,3,'single')
where the code returns error messages. The first few lines of the error message reads:
---------------------------------------
Error executing command "touch -c /home/pi/MATLAB_ws/R2024b/C/Users/phn/Documents/MATLAB/Examples/R2024b/deeplearning_shared/SemanticSegmentationUsingTFLiteModelOnHostAndRasPiExample/codegen/lib/tflite_semantic_predict/*.*;make -j$(($(nproc)+1)) -Otarget -f tflite_semantic_predict_rtw.mk all MATLAB_WORKSPACE="/home/pi/MATLAB_ws/R2024b" LINUX_TARGET_LIBS_MACRO="" -C /home/pi/MATLAB_ws/R2024b/C/Users/phn/Documents/MATLAB/Examples/R2024b/deeplearning_shared/SemanticSegmentationUsingTFLiteModelOnHostAndRasPiExample/codegen/lib/tflite_semantic_predict". Details:
STDERR: In file included from /home/pi/MATLAB_ws/R2024b/C/Program_Files/MATLAB/R2024b/toolbox/tflite_interface/invokeinterpreter/invokeinterpreter.cpp:6:
/home/pi/MATLAB_ws/R2024b/C/Program_Files/MATLAB/R2024b/toolbox/tflite_interface/invokeinterpreter/export/include/invokeinterpreter/invokeinterpreter.hpp:16:10: fatal error: kernels/register.h: No such file or directory
#include "kernels/register.h"
^~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [tflite_semantic_predict_rtw.mk:382: invokeinterpreter.cpp.o] Error 1
make: *** Waiting for unfinished jobs....
---------------------------------------
The complete error message is attached.
Could anyone let me know how to fix this? Seems that the file kernels/register.h is missing, but I'm not sure how to fix this. Installing kernel headers on Raspberry Pi through "sudo apt install linux-headers-rpi" did not solve the problem.
Thank you!

Akzeptierte Antwort

Gayathri
Gayathri am 9 Jan. 2025
Hi @Peng,
By looking at the error, it seems like the Third-Party Prerequisite "TFLite library on the target ARM® hardware" is not properly installed.
Please refer to the below links which mentions the Third-Party Prerequisites required for running the example mentioned in the question.
For properly installing "TensorFlow Lite", please look into the below "MATLAB Answers" link.
If you have already installed it, please try reinstalling the library.
Hope you find this information helpful!
  3 Kommentare
Peng
Peng am 20 Jan. 2025 um 2:30
I somehow found a solution to my own problem. It was indeed a compatibility issue between VC and Bazel. When I reinstalled Bazel with version 6.3.0, the error disappeared and I could build tensorflow lite with Bazel without error. Older or newer version of Bazel did not work for me.
Gayathri
Gayathri am 20 Jan. 2025 um 9:06
Good to know that the issue is resolved now! Thanks for sharing the update.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Produkte


Version

R2024b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by