-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharena_size_test.cpp
More file actions
53 lines (41 loc) · 985 Bytes
/
arena_size_test.cpp
File metadata and controls
53 lines (41 loc) · 985 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#include <cmath>
#include <iostream>
#include <cstdlib>
#include <iostream>
#include <stdio.h>
#include "pico/stdlib.h"
#include "pico/multicore.h"
#include "pico/sync.h"
#include "hardware/watchdog.h"
#include "hardware/sync.h"
#include "DEV_Config.h"
#include "model.h"
#include "model_settings.h"
#include "mnist_model_data.h"
using namespace std;
Model ml_model;
int main() {
System_Init();
sleep_ms(1000);
// initialize ML model
if (!ml_model.setup()) {
printf("Failed to initialize ML model!\n");
return -1;
}
printf("Model initialized\n");
uint8_t* test_image_input = ml_model.input_data();
if (test_image_input == nullptr) {
printf("Cannot set input\n");
return -1;
}
int byte_size = ml_model.byte_size();
if (!byte_size) {
printf("Byte size not found\n");
return -1;
}
while(1) {
printf("The tensor arena size: %d\n", ml_model.interpreter->arena_used_bytes());
sleep_ms(20000);
}
return 0;
}