Generating C code with TVM
Compiling the TFLite model to C code is straightforward with TVM. TVM only needs an input model, a target device, and a single command line to generate a TAR package with the generated C code.
In this recipe, we will show how to convert a pretrained CIFAR-10 model into C code with microTVM, an extension of TVM for microcontroller deployment.
The following Bash script contains the commands referred to in this recipe:
compile_model_microtvm.sh
:
Getting ready
In this section, we will examine how TVM can generate C code and explain what microTVM is.
TVM is a DL compiler technology that we can use in Python and in the same environment where we build, train, and quantize the model with TFLite. Although TVM natively offers a Python API, there is an alternative and more straightforward API that is based on a command-line interface...