Hi!
I am encountering a problem when I am trying to deploy a TFLite mode for semantic segmentation on Raspberry Pi. I was following this example and executed the code by opening the example: openExample('deeplearning_shared/SemanticSegmentationUsingTFLiteModelOnHostAndRasPiExample')
I have configured my computer and Raspberry Pi according to the instructions. I will provide details of their setup at the end of this message. I had not problem generating the MEX file by running the example code. I did need to add the following line of code after "cfg.Hardware = hw;" and before the (second) "codegen -config cfg tflite_semantic_predict -args ones(257,257,3,'single')" command for PIL generation:
cfg.CustomInclude = ["C:\tensorflow-2.15.0\tensorflow\lite", "C:\tensorflow-2.15.0"];
Here, "C:\tensorflow-2.15.0" is where TFLite is installed on the Windows computer. When I re-ran the code, I do not encounter the error messages any more. However, the problem I am facing now is that the code seems to be stuck on the "codegen" line. The code ran for 12 hours, and MATLAB was still under "busy" status, which seemed odd to me. I didn't see any error or warning messages either.
I monitored the CPU usage: it dropped significantly around 30 seconds after executing the codegen line, while the command window continued showing 'busy' status. When I click 'pause', the pause button grayed out, while command window still showed 'busy' status, which is strange. I had to click the 'stop' button to force the code into the 'pause' status, and the 'continue running' option was enabled. I tried this a few times, and the code was always paused at the 'obj.task();' line inside a delete(obj) function within the onCleanup.m class.
I'd appreciate any suggestions on how to debug this issue.
Here is how I set up the Windows computer and the Pi. I installed the TFLite library on the local Windows computer directly under "C:\tensorflow-2.15.0" following this instruction:
On Raspberry Pi 4b (buster; 32bit OS), I installed TFLite under "/home/pi/tensorflow/tensorflow/" following this:
Additionally, the environment variables are set on both the local and raspi machines according to: