Fix for hello_world memory error

PiperOrigin-RevId: 312707164
Change-Id: Ibdc1b5bd2161daa093cc79f165c03ac5a6c99acc
This commit is contained in:
Pete Warden 2020-05-21 11:27:43 -07:00 committed by TensorFlower Gardener
parent c030682e9c
commit 5d3ad40d11
1 changed files with 6 additions and 2 deletions

View File

@ -34,8 +34,12 @@ TfLiteTensor* output = nullptr;
int inference_count = 0; int inference_count = 0;
// Create an area of memory to use for input, output, and intermediate arrays. // Create an area of memory to use for input, output, and intermediate arrays.
// Finding the minimum value for your model may require some trial and error. // Minimum arena size, at the time of writing. After allocating tensors
constexpr int kTensorArenaSize = 2 * 1024; // you can retrieve this value by invoking interpreter.arena_used_bytes().
const int kModelArenaSize = 2352;
// Extra headroom for model + alignment + future interpreter changes.
const int kExtraArenaSize = 560 + 16 + 100;
const int kTensorArenaSize = kModelArenaSize + kExtraArenaSize;
uint8_t tensor_arena[kTensorArenaSize]; uint8_t tensor_arena[kTensorArenaSize];
} // namespace } // namespace