You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have followed the steps mentioned in tensorflow/lite/micro/docs/memory_management.md to identify tensor arena for a given network and then allocated the reported memory to run model inference.
However, after Invoke(), we run into allocation issues in network level Prepare() / tensor allocation functions.
We suspect that the Recording Memory APIs do not consider the memory needed by temporary_buffer allocations in the Prepare() stage.
The total arena size reported = Head(Scratch) + Tail (Persist) which is required by the network during Eval() stage.
But the actual memory size needed is greater than what’s reported. We also think that Tail memory (Persist) is allocated first
and then the remaining memory may/may-not be sufficient for Head + Temp allocations depending on the model.
We have a sample model for which we run into arena size related errors. Sharing details below:
For the sample model, the arena size reported was:
On allocating and running with 960 bytes arena, we see the following error:
Steps to reproduce:
a. Extract sample_model.zip attached and copy the sample_model folder in tensorflow/lite/micro/examples/
b. >> make -f tensorflow/lite/micro/tools/make/Makefile test_sample_model_test
c. In order to print the arena size report details, un-comment line 28 in sample_model/sample_model_test.cc
We have followed the steps mentioned in tensorflow/lite/micro/docs/memory_management.md to identify tensor arena for a given network and then allocated the reported memory to run model inference.
However, after Invoke(), we run into allocation issues in network level Prepare() / tensor allocation functions.
We suspect that the Recording Memory APIs do not consider the memory needed by temporary_buffer allocations in the Prepare() stage.
The total arena size reported = Head(Scratch) + Tail (Persist) which is required by the network during Eval() stage.
But the actual memory size needed is greater than what’s reported. We also think that Tail memory (Persist) is allocated first
and then the remaining memory may/may-not be sufficient for Head + Temp allocations depending on the model.
We have a sample model for which we run into arena size related errors. Sharing details below:
a. Extract sample_model.zip attached and copy the sample_model folder in tensorflow/lite/micro/examples/
b. >> make -f tensorflow/lite/micro/tools/make/Makefile test_sample_model_test
c. In order to print the arena size report details, un-comment line 28 in sample_model/sample_model_test.cc
CC: @suleshahid @pyu10055 @TFLM-bot
The text was updated successfully, but these errors were encountered: