Skip to content

Commit

Permalink
Increase arena size to accomodate larger models. (#2188)
Browse files Browse the repository at this point in the history
Note that http://b/297592546 was also uncovered while working on this change. Tested with http://b/297590931#comment2

BUG=http://b/297590931
  • Loading branch information
advaitjain authored Aug 25, 2023
1 parent c795f31 commit 563f79f
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ constexpr uint32_t kRandomSeed = 0xFB;
// Which format should be used to output debug information.
constexpr PrettyPrintType kPrintType = PrettyPrintType::kTable;

constexpr size_t kTensorArenaSize = 1024 * 1024;
constexpr size_t kTensorArenaSize = 3e6;
constexpr int kNumResourceVariable = 100;
constexpr size_t kModelSize = 511408;
constexpr size_t kModelSize = 2e6;

void SetRandomInput(const uint32_t random_seed,
tflite::MicroInterpreter& interpreter) {
Expand Down Expand Up @@ -86,7 +86,11 @@ bool ReadFile(const char* file_name, void* buffer, size_t buffer_size) {
return false;
}
if (!feof(file.get())) {
MicroPrintf("Model buffer is too small for the model.\n");
// Note that http://b/297592546 can mean that this error message is
// confusing.
MicroPrintf(
"Model buffer (%d bytes) is too small for the model (%d bytes).\n",
buffer_size, bytes_read);
return false;
}
if (bytes_read == 0) {
Expand Down

0 comments on commit 563f79f

Please sign in to comment.