README.md
1<!-- mdformat off(b/169948621#comment2) -->
2
3# Hello World Example
4
5This example is designed to demonstrate the absolute basics of using [TensorFlow
6Lite for Microcontrollers](https://www.tensorflow.org/lite/microcontrollers).
7It includes the full end-to-end workflow of training a model, converting it for
8use with TensorFlow Lite for Microcontrollers for running inference on a
9microcontroller.
10
11The model is trained to replicate a `sine` function and generates a pattern of
12data to either blink LEDs or control an animation, depending on the capabilities
13of the device.
14
15![Animation on STM32F746](images/animation_on_STM32F746.gif)
16
17## Table of contents
18
19- [Running on ARC](#running-on-ARC)
20- [Deploy to Arduino](#deploy-to-arduino)
21- [Deploy to ESP32](#deploy-to-esp32)
22- [Deploy to Himax WE1 EVB](#deploy-to-himax-we1-evb)
23- [Deploy to SparkFun Edge](#deploy-to-sparkfun-edge)
24- [Deploy to STM32F746](#deploy-to-STM32F746)
25- [Run the tests on a development machine](#run-the-tests-on-a-development-machine)
26- [Train your own model](#train-your-own-model)
27
28## Running on ARC
29
30### **Deploy on ARC EMSDP**
31The following instructions will help you to build and deploy this example to
32[ARC EM SDP](https://www.synopsys.com/dw/ipdir.php?ds=arc-em-software-development-platform)
33board. General information and instructions on using the board with TensorFlow
34Lite Micro can be found in the common
35[ARC targets description](/tensorflow/lite/micro/tools/make/targets/arc/README.md).
36
37### Initial Setup
38
39Follow the instructions on the
40[ARC EM SDP Initial Setup](/tensorflow/lite/micro/tools/make/targets/arc/README.md#ARC-EM-Software-Development-Platform-ARC-EM-SDP)
41to get and install all required tools for work with ARC EM SDP.
42
43### Generate Example Project
44
45The example project for ARC EM SDP platform can be generated with the following
46command:
47
48```
49make -f tensorflow/lite/micro/tools/make/Makefile \
50TARGET=arc_emsdp \
51OPTIMIZED_KERNEL_DIR=arc_mli \
52generate_hello_world_make_project
53```
54
55### Build and Run Example
56
57For more detailed information on building and running examples see the
58appropriate sections of general descriptions of the
59[ARC EM SDP usage with TensorFlow Lite Micro (TFLM)](/tensorflow/lite/micro/tools/make/targets/arc/README.md#ARC-EM-Software-Development-Platform-ARC-EM-SDP).
60In the directory with generated project you can also find a
61*README_ARC_EMSDP.md* file with instructions and options on building and
62running. Here we only briefly mention main steps which are typically enough to
63get it started.
64
651. You need to
66 [connect the board](/tensorflow/lite/micro/tools/make/targets/arc/README.md#connect-the-board)
67 and open an serial connection.
68
692. Go to the generated example project directory.
70
71 ```
72 cd tensorflow/lite/micro/tools/make/gen/arc_emsdp_arc_default/prj/hello_world/make
73 ```
74
753. Build the example using
76
77 ```
78 make app
79 ```
80
814. To generate artefacts for self-boot of example from the board use
82
83 ```
84 make flash
85 ```
86
875. To run application from the board using microSD card:
88
89 * Copy the content of the created /bin folder into the root of microSD
90 card. Note that the card must be formatted as FAT32 with default cluster
91 size (but less than 32 Kbytes)
92 * Plug in the microSD card into the J11 connector.
93 * Push the RST button. If a red LED is lit beside RST button, push the CFG
94 button.
95 * Type or copy next commands one-by-another into serial terminal: `setenv
96 loadaddr 0x10800000 setenv bootfile app.elf setenv bootdelay 1 setenv
97 bootcmd fatload mmc 0 \$\{loadaddr\} \$\{bootfile\} \&\& bootelf
98 saveenv`
99 * Push the RST button.
100
1016. If you have the MetaWare Debugger installed in your environment:
102
103 * To run application from the console using it type `make run`.
104 * To stop the execution type `Ctrl+C` in the console several times.
105
106In both cases (step 5 and 6) you will see the application output in the serial
107terminal.
108
109### **Deploy on ARC VPX processor**
110
111The [embARC MLI Library 2.0](https://github.com/foss-for-synopsys-dwc-arc-processors/embarc_mli/tree/Release_2.0_EA) enables TFLM library and examples to be used with the ARC VPX processor. This is currently an experimental feature. General information and instructions on using embARC MLI Library 2.0 with TFLM can be found in the common [ARC targets description](/tensorflow/lite/micro/tools/make/targets/arc/README.md).
112
113### Initial Setup
114
115Follow the instructions in the [Custom ARC EM/HS/VPX Platform](/tensorflow/lite/micro/tools/make/targets/arc/README.md#Custom-ARC-EMHSVPX-Platform) section to get and install all the required tools for working with the ARC VPX Processor.
116
117### Generate Example Project
118
119The example project for ARC VPX platform can be generated with the following
120command:
121
122```
123make -f tensorflow/lite/micro/tools/make/Makefile \
124TARGET=arc_custom\
125ARC_TAGS=mli20_experimental \
126BUILD_LIB_DIR=<path_to_buildlib> \
127TCF_FILE=<path_to_tcf_file> \
128LCF_FILE=<path_to_lcf_file> \
129OPTIMIZED_KERNEL_DIR=arc_mli \
130generate_person_detection_int8_make_project
131```
132TCF file for VPX Processor can be generated using tcfgen tool which is part of [MetaWare Development Toolkit](#MetaWare-Development-Toolkit). \
133The following command can be used to generate TCF file to run applications on VPX Processor using nSIM Simulator:
134```
135tcfgen -o vpx5_integer_full.tcf -tcf=vpx5_integer_full -iccm_size=0x80000 -dccm_size=0x40000
136```
137VPX Processor configuration may require a custom run-time library specified using the BUILD_LIB_DIR option. Please, check MLI Library 2.0 [documentation](https://github.com/foss-for-synopsys-dwc-arc-processors/embarc_mli/tree/Release_2.0_EA#build-configuration-options) for more details.
138
139### Build and Run Example
140
141For more detailed information on building and running examples see the
142appropriate sections of general descriptions of the
143[Custom ARC EM/HS/VPX Platform](/tensorflow/lite/micro/tools/make/targets/arc/README.md#Custom-ARC-EMHSVPX-Platform).
144In the directory with generated project you can also find a
145*README_ARC.md* file with instructions and options on building and
146running. Here we only briefly mention main steps which are typically enough to
147get started.
148
1491. Go to the generated example project directory.
150
151 ```
152 cd tensorflow/lite/micro/tools/make/gen/vpx5_integer_full_mli20_arc_default/prj/hello_world/make
153 ```
154
1552. Build the example using
156
157 ```
158 make app
159 ```
160
1613. To run application from the MetaWare Debugger installed in your environment:
162
163 * From the console, type `make run`.
164 * To stop the execution type `Ctrl+C` in the console several times.
165
166In both cases (step 5 and 6) you will see the application output in the serial
167terminal.
168
169## Deploy to Arduino
170
171The following instructions will help you build and deploy this sample
172to [Arduino](https://www.arduino.cc/) devices.
173
174![Animation on Arduino MKRZERO](images/animation_on_arduino_mkrzero.gif)
175
176The sample has been tested with the following devices:
177
178- [Arduino Nano 33 BLE Sense](https://store.arduino.cc/usa/nano-33-ble-sense-with-headers)
179- [Arduino MKRZERO](https://store.arduino.cc/usa/arduino-mkrzero)
180
181The sample will use PWM to fade an LED on and off according to the model's
182output. In the code, the `LED_BUILTIN` constant is used to specify the board's
183built-in LED as the one being controlled. However, on some boards, this built-in
184LED is not attached to a pin with PWM capabilities. In this case, the LED will
185blink instead of fading.
186
187### Install the Arduino_TensorFlowLite library
188
189This example application is included as part of the official TensorFlow Lite
190Arduino library. To install it, open the Arduino library manager in
191`Tools -> Manage Libraries...` and search for `Arduino_TensorFlowLite`.
192
193### Load and run the example
194
195Once the library has been added, go to `File -> Examples`. You should see an
196example near the bottom of the list named `TensorFlowLite:hello_world`. Select
197it and click `hello_world` to load the example.
198
199Use the Arduino IDE to build and upload the example. Once it is running,
200you should see the built-in LED on your device flashing.
201
202The Arduino Desktop IDE includes a plotter that we can use to display the sine
203wave graphically. To view it, go to `Tools -> Serial Plotter`. You will see one
204datapoint being logged for each inference cycle, expressed as a number between 0
205and 255.
206
207## Deploy to ESP32
208
209The following instructions will help you build and deploy this sample
210to [ESP32](https://www.espressif.com/en/products/hardware/esp32/overview)
211devices using the [ESP IDF](https://github.com/espressif/esp-idf).
212
213The sample has been tested on ESP-IDF version 4.0 with the following devices:
214- [ESP32-DevKitC](http://esp-idf.readthedocs.io/en/latest/get-started/get-started-devkitc.html)
215- [ESP-EYE](https://github.com/espressif/esp-who/blob/master/docs/en/get-started/ESP-EYE_Getting_Started_Guide.md)
216
217### Install the ESP IDF
218
219Follow the instructions of the
220[ESP-IDF get started guide](https://docs.espressif.com/projects/esp-idf/en/latest/get-started/index.html)
221to setup the toolchain and the ESP-IDF itself.
222
223The next steps assume that the
224[IDF environment variables are set](https://docs.espressif.com/projects/esp-idf/en/latest/get-started/index.html#step-4-set-up-the-environment-variables) :
225
226 * The `IDF_PATH` environment variable is set
227 * `idf.py` and Xtensa-esp32 tools (e.g. `xtensa-esp32-elf-gcc`) are in `$PATH`
228
229### Generate the examples
230The example project can be generated with the following command:
231```
232make -f tensorflow/lite/micro/tools/make/Makefile TARGET=esp generate_hello_world_esp_project
233```
234
235### Building the example
236
237Go to the example project directory `cd
238tensorflow/lite/micro/tools/make/gen/esp_xtensa-esp32/prj/hello_world/esp-idf`
239
240Then build with `idf.py`
241```
242idf.py build
243```
244
245### Load and run the example
246
247To flash (replace `/dev/ttyUSB0` with the device serial port):
248```
249idf.py --port /dev/ttyUSB0 flash
250```
251
252Monitor the serial output:
253```
254idf.py --port /dev/ttyUSB0 monitor
255```
256
257Use `Ctrl+]` to exit.
258
259The previous two commands can be combined:
260```
261idf.py --port /dev/ttyUSB0 flash monitor
262```
263
264## Deploy to Himax WE1 EVB
265
266The following instructions will help you build and deploy this example to
267[HIMAX WE1 EVB](https://github.com/HimaxWiseEyePlus/bsp_tflu/tree/master/HIMAX_WE1_EVB_board_brief)
268board. To understand more about using this board, please check
269[HIMAX WE1 EVB user guide](https://github.com/HimaxWiseEyePlus/bsp_tflu/tree/master/HIMAX_WE1_EVB_user_guide).
270
271### Initial Setup
272
273To use the HIMAX WE1 EVB, please make sure following software are installed:
274
275#### MetaWare Development Toolkit
276
277See
278[Install the Synopsys DesignWare ARC MetaWare Development Toolkit](/tensorflow/lite/micro/tools/make/targets/arc/README.md#install-the-synopsys-designware-arc-metaware-development-toolkit)
279section for instructions on toolchain installation.
280
281#### Make Tool version
282
283A `'make'` tool is required for deploying Tensorflow Lite Micro applications on
284HIMAX WE1 EVB, See
285[Check make tool version](/tensorflow/lite/micro/tools/make/targets/arc/README.md#make-tool)
286section for proper environment.
287
288#### Serial Terminal Emulation Application
289
290There are 2 main purposes for HIMAX WE1 EVB Debug UART port
291
292- print application output
293- burn application to flash by using xmodem send application binary
294
295You can use any terminal emulation program (like [PuTTY](https://www.putty.org/)
296or [minicom](https://linux.die.net/man/1/minicom)).
297
298### Generate Example Project
299
300The example project for HIMAX WE1 EVB platform can be generated with the
301following command:
302
303Download related third party data
304
305```
306make -f tensorflow/lite/micro/tools/make/Makefile TARGET=himax_we1_evb third_party_downloads
307```
308
309Generate hello world project
310
311```
312make -f tensorflow/lite/micro/tools/make/Makefile generate_hello_world_make_project TARGET=himax_we1_evb
313```
314
315### Build and Burn Example
316
317Following the Steps to run hello world example at HIMAX WE1 EVB platform.
318
3191. Go to the generated example project directory.
320
321 ```
322 cd tensorflow/lite/micro/tools/make/gen/himax_we1_evb_arc/prj/hello_world/make
323 ```
324
3252. Build the example using
326
327 ```
328 make app
329 ```
330
3313. After example build finish, copy ELF file and map file to image generate
332 tool directory. \
333 image generate tool directory located at
334 `'tensorflow/lite/micro/tools/make/downloads/himax_we1_sdk/image_gen_linux_v3/'`
335
336 ```
337 cp hello_world.elf himax_we1_evb.map ../../../../../downloads/himax_we1_sdk/image_gen_linux_v3/
338 ```
339
3404. Go to flash image generate tool directory.
341
342 ```
343 cd ../../../../../downloads/himax_we1_sdk/image_gen_linux_v3/
344 ```
345
346 make sure this tool directory is in $PATH. You can permanently set it to
347 PATH by
348
349 ```
350 export PATH=$PATH:$(pwd)
351 ```
352
3535. run image generate tool, generate flash image file.
354
355 * Before running image generate tool, by typing `sudo chmod +x image_gen`
356 and `sudo chmod +x sign_tool` to make sure it is executable.
357
358 ```
359 image_gen -e hello_world.elf -m himax_we1_evb.map -o out.img
360 ```
361
3626. Download flash image file to HIMAX WE1 EVB by UART:
363
364 * more detail about download image through UART can be found at
365 [HIMAX WE1 EVB update Flash image](https://github.com/HimaxWiseEyePlus/bsp_tflu/tree/master/HIMAX_WE1_EVB_user_guide#flash-image-update)
366
367After these steps, press reset button on the HIMAX WE1 EVB, you will see
368application output in the serial terminal.
369
370## Deploy to SparkFun Edge
371
372The following instructions will help you build and deploy this sample on the
373[SparkFun Edge development board](https://sparkfun.com/products/15170).
374
375![Animation on SparkFun Edge](images/animation_on_sparkfun_edge.gif)
376
377If you're new to using this board, we recommend walking through the
378[AI on a microcontroller with TensorFlow Lite and SparkFun Edge](https://codelabs.developers.google.com/codelabs/sparkfun-tensorflow)
379codelab to get an understanding of the workflow.
380
381### Compile the binary
382
383The following command will download the required dependencies and then compile a
384binary for the SparkFun Edge:
385
386```
387make -f tensorflow/lite/micro/tools/make/Makefile TARGET=sparkfun_edge hello_world_bin
388```
389
390The binary will be created in the following location:
391
392```
393tensorflow/lite/micro/tools/make/gen/sparkfun_edge_cortex-m4/bin/hello_world.bin
394```
395
396### Sign the binary
397
398The binary must be signed with cryptographic keys to be deployed to the device.
399We'll now run some commands that will sign our binary so it can be flashed to
400the SparkFun Edge. The scripts we are using come from the Ambiq SDK, which is
401downloaded when the `Makefile` is run.
402
403Enter the following command to set up some dummy cryptographic keys we can use
404for development:
405
406```
407cp tensorflow/lite/micro/tools/make/downloads/AmbiqSuite-Rel2.2.0/tools/apollo3_scripts/keys_info0.py \
408tensorflow/lite/micro/tools/make/downloads/AmbiqSuite-Rel2.2.0/tools/apollo3_scripts/keys_info.py
409```
410
411Next, run the following command to create a signed binary:
412
413```
414python3 tensorflow/lite/micro/tools/make/downloads/AmbiqSuite-Rel2.2.0/tools/apollo3_scripts/create_cust_image_blob.py \
415--bin tensorflow/lite/micro/tools/make/gen/sparkfun_edge_cortex-m4/bin/hello_world.bin \
416--load-address 0xC000 \
417--magic-num 0xCB \
418-o main_nonsecure_ota \
419--version 0x0
420```
421
422This will create the file `main_nonsecure_ota.bin`. We'll now run another
423command to create a final version of the file that can be used to flash our
424device with the bootloader script we will use in the next step:
425
426```
427python3 tensorflow/lite/micro/tools/make/downloads/AmbiqSuite-Rel2.2.0/tools/apollo3_scripts/create_cust_wireupdate_blob.py \
428--load-address 0x20000 \
429--bin main_nonsecure_ota.bin \
430-i 6 \
431-o main_nonsecure_wire \
432--options 0x1
433```
434
435You should now have a file called `main_nonsecure_wire.bin` in the directory
436where you ran the commands. This is the file we'll be flashing to the device.
437
438### Flash the binary
439
440Next, attach the board to your computer via a USB-to-serial adapter.
441
442**Note:** If you're using the [SparkFun Serial Basic Breakout](https://www.sparkfun.com/products/15096),
443you should [install the latest drivers](https://learn.sparkfun.com/tutorials/sparkfun-serial-basic-ch340c-hookup-guide#drivers-if-you-need-them)
444before you continue.
445
446Once connected, assign the USB device name to an environment variable:
447
448```
449export DEVICENAME=put your device name here
450```
451
452Set another variable with the baud rate:
453
454```
455export BAUD_RATE=921600
456```
457
458Now, hold the button marked `14` on the device. While still holding the button,
459hit the button marked `RST`. Continue holding the button marked `14` while
460running the following command:
461
462```
463python3 tensorflow/lite/micro/tools/make/downloads/AmbiqSuite-Rel2.2.0/tools/apollo3_scripts/uart_wired_update.py \
464-b ${BAUD_RATE} ${DEVICENAME} \
465-r 1 \
466-f main_nonsecure_wire.bin \
467-i 6
468```
469
470You should see a long stream of output as the binary is flashed to the device.
471Once you see the following lines, flashing is complete:
472
473```
474Sending Reset Command.
475Done.
476```
477
478If you don't see these lines, flashing may have failed. Try running through the
479steps in [Flash the binary](#flash-the-binary) again (you can skip over setting
480the environment variables). If you continue to run into problems, follow the
481[AI on a microcontroller with TensorFlow Lite and SparkFun Edge](https://codelabs.developers.google.com/codelabs/sparkfun-tensorflow)
482codelab, which includes more comprehensive instructions for the flashing
483process.
484
485The binary should now be deployed to the device. Hit the button marked `RST` to
486reboot the board. You should see the device's four LEDs flashing in sequence.
487
488Debug information is logged by the board while the program is running. To view
489it, establish a serial connection to the board using a baud rate of `115200`.
490On OSX and Linux, the following command should work:
491
492```
493screen ${DEVICENAME} 115200
494```
495
496You will see a lot of output flying past! To stop the scrolling, hit `Ctrl+A`,
497immediately followed by `Esc`. You can then use the arrow keys to explore the
498output, which will contain the results of running inference on various `x`
499values:
500
501```
502x_value: 1.1843798*2^2, y_value: -1.9542645*2^-1
503```
504
505To stop viewing the debug output with `screen`, hit `Ctrl+A`, immediately
506followed by the `K` key, then hit the `Y` key.
507
508
509## Deploy to STM32F746
510
511The following instructions will help you build and deploy the sample to the
512[STM32F7 discovery kit](https://os.mbed.com/platforms/ST-Discovery-F746NG/)
513using [ARM Mbed](https://github.com/ARMmbed/mbed-cli).
514
515![Animation on STM32F746](images/animation_on_STM32F746.gif)
516
517Before we begin, you'll need the following:
518
519- STM32F7 discovery kit board
520- Mini-USB cable
521- ARM Mbed CLI ([installation instructions](https://os.mbed.com/docs/mbed-os/v6.9/quick-start/build-with-mbed-cli.html). Check it out for MacOS Catalina - [mbed-cli is broken on MacOS Catalina #930](https://github.com/ARMmbed/mbed-cli/issues/930#issuecomment-660550734))
522- Python 3 and pip3
523
524Since Mbed requires a special folder structure for projects, we'll first run a
525command to generate a subfolder containing the required source files in this
526structure:
527
528```
529make -f tensorflow/lite/micro/tools/make/Makefile TARGET=disco_f746ng OPTIMIZED_KERNEL_DIR=cmsis_nn generate_hello_world_mbed_project
530```
531
532This will result in the creation of a new folder:
533
534```
535tensorflow/lite/micro/tools/make/gen/disco_f746ng_cortex-m4_default/prj/hello_world/mbed
536```
537
538This folder contains all of the example's dependencies structured in the correct
539way for Mbed to be able to build it.
540
541Change into the directory and run the following commands.
542
543First, tell Mbed that the current directory is the root of an Mbed project:
544
545```
546mbed config root .
547```
548
549Next, tell Mbed to download the dependencies and prepare to build:
550
551```
552mbed deploy
553```
554
555Older versions of Mbed will build the project using C++98. However, TensorFlow Lite
556requires C++11. If needed, run the following Python snippet to modify the Mbed
557configuration files so that it uses C++11:
558
559```
560python -c 'import fileinput, glob;
561for filename in glob.glob("mbed-os/tools/profiles/*.json"):
562 for line in fileinput.input(filename, inplace=True):
563 print(line.replace("\"-std=gnu++98\"","\"-std=c++11\", \"-fpermissive\""))'
564
565```
566
567Note: Mbed has a dependency to an old version of arm_math.h and cmsis_gcc.h (adapted from the general [CMSIS-NN MBED example](https://github.com/tensorflow/tflite-micro/blob/main/tensorflow/lite/micro/kernels/cmsis_nn#example-2---mbed)). Therefore you need to copy the newer version as follows:
568```bash
569cp tensorflow/lite/micro/tools/make/downloads/cmsis/CMSIS/DSP/Include/\
570arm_math.h mbed-os/cmsis/TARGET_CORTEX_M/arm_math.h
571cp tensorflow/lite/micro/tools/make/downloads/cmsis/CMSIS/Core/Include/\
572cmsis_gcc.h mbed-os/cmsis/TARGET_CORTEX_M/cmsis_gcc.h
573```
574
575Finally, run the following command to compile:
576
577```
578mbed compile -m DISCO_F746NG -t GCC_ARM
579```
580
581This should result in a binary at the following path:
582
583```
584./BUILD/DISCO_F746NG/GCC_ARM/mbed.bin
585```
586
587To deploy, plug in your STM board and copy the file to it. On MacOS, you can do
588this with the following command:
589
590```
591cp ./BUILD/DISCO_F746NG/GCC_ARM/mbed.bin /Volumes/DIS_F746NG/
592```
593
594Copying the file will initiate the flashing process. Once this is complete, you
595should see an animation on the device's screen.
596
597
598```
599screen /dev/tty.usbmodem14403 9600
600```
601
602In addition to this animation, debug information is logged by the board while
603the program is running. To view it, establish a serial connection to the board
604using a baud rate of `9600`. On OSX and Linux, the following command should
605work, replacing `/dev/tty.devicename` with the name of your device as it appears
606in `/dev`:
607
608```
609screen /dev/tty.devicename 9600
610```
611
612You will see a lot of output flying past! To stop the scrolling, hit `Ctrl+A`,
613immediately followed by `Esc`. You can then use the arrow keys to explore the
614output, which will contain the results of running inference on various `x`
615values:
616
617```
618x_value: 1.1843798*2^2, y_value: -1.9542645*2^-1
619```
620
621To stop viewing the debug output with `screen`, hit `Ctrl+A`, immediately
622followed by the `K` key, then hit the `Y` key.
623
624## Run the tests on a development machine
625
626To compile and test this example on a desktop Linux or macOS machine, first
627clone the TensorFlow repository from GitHub to a convenient place:
628
629```bash
630git clone --depth 1 https://github.com/tensorflow/tensorflow.git
631```
632
633Next, `cd` into the source directory from a terminal, and then run the following
634command:
635
636```bash
637make -f tensorflow/lite/micro/tools/make/Makefile test_hello_world_test
638```
639
640This will take a few minutes, and downloads frameworks the code uses. Once the
641process has finished, you should see a series of files get compiled, followed by
642some logging output from a test, which should conclude with
643`~~~ALL TESTS PASSED~~~`.
644
645If you see this, it means that a small program has been built and run that loads
646the trained TensorFlow model, runs some example inputs through it, and got the
647expected outputs.
648
649To understand how TensorFlow Lite does this, you can look at the source in
650[hello_world_test.cc](hello_world_test.cc).
651It's a fairly small amount of code that creates an interpreter, gets a handle to
652a model that's been compiled into the program, and then invokes the interpreter
653with the model and sample inputs.
654
655## Train your own model
656
657So far you have used an existing trained model to run inference on
658microcontrollers. If you wish to train your own model, follow the instructions
659given in the [train/](train/) directory.
660
661