Error running example "Deploy Semantic Segmentation Application Using TensorFlow Lite..."
10 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Peng
el 8 de En. de 2025
Comentada: Gayathri
el 20 de En. de 2025
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!
0 comentarios
Respuesta aceptada
Gayathri
el 9 de En. de 2025
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 comentarios
Gayathri
el 20 de En. de 2025
Good to know that the issue is resolved now! Thanks for sharing the update.
Más respuestas (0)
Ver también
Categorías
Más información sobre CPU Code Generation from MATLAB Applications en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!