Open Red-Caesar opened 1 year ago
About 0.8.0 TVM version. I found this discussion. It says that there was problem with python setup early. I found this commit. So the problem with python setup solved, after changing code to state of this commit.
But after this, I also had problem with launch_microtvm_api_server.sh(There were only one python version (3.10) and one tvm version on PC)
So I just copy this file from the next version and change generate_project.py script to find a new location of file.
After this there were some problems with libraries, but it's fixable. Now, I can compile .tflite model, which libs’ files similar to guberti libs’ files.. I’ve also checked that micro_speech.tflite, compiled by this tvm version, works (compilation doesn’t work with the latest version). But kws.tflite has a problem anyway. So I will check that I can do else. My suggestions:
@vvchernov
The next update will be about building and flashing with Zephyr.
I've again used this tutorial for installing Zephyr and tvmc commands.
After a step, where we should compile micro_speech.tflite
, I used following commands:
tvmc micro create -f project model.tar zephyr --project-option project_type=host_driven board=nrf5340dk_nrf5340_cpuapp zephyr_base=/home/andrey/Documents/ZephyrTutorial/content/zephyrproject/zephyr/
After that, we should put path to sdk in FindZephyr-sdk.cmake
:
And run commands from directory content/zephyrproject/zephyr
:
tvmc micro build -f ../../project zephyr
tvmc micro flash ../../project zephyr
It gives an error:
It happens, because command 'nrfjprog —ids' can't find the board. (Even if board is fine and can be checked by lsusb
). My suggestion: nrfjprog utility isn't working for arduino nano.
If we used west for flashing, we will have:
west flash --bossac=/home/andrey/snap/arduino/85/.arduino15/packages/arduino/tools/bossac/1.9.1-arduino2/bossac --build-dir=../project/build
And an error:
I think, it happens, because of tvmc micro create
and a flag board=nrf5340dk_nrf5340_cpuapp
. My suggestion: tvmc command creates a project with specific flashing settings required for this board. So we can't just use it with arduino nano.
Also I can't directly use flag board=nano33ble
, because this is not supported by zephyr_base
command.
So, to solve the problem I can try to add nano33ble support.
I use this two tutorial: tvmc and demo.
For implementation, I use the following commands:
(1)
(2)
Before the next command, we should take from
examples/yes_no
following files:yes_no.ino
,yes.h
,no.h
,src
. And add to project directory. Renameyes_no.ino
toproject.ino
(3)
After the command we will have:
And the last command:
(4)
It will be work fine.
This the part if we will try to compile model on our own.
Repeat (1) and (2) commands. We will have next files:
project.ino
src/platform.h
src/platform.c
And we’ve already had differences from demo.
In demo’s src/model.h . We have a defenition of
void TVMInitialize()
. In ourproject.ino
we haven’t, so we should include in this file:#include "src/standalone_crt/include/tvm/runtime/crt/platform.h"
Also, demo’s src/model.c has library
#include "standalone_crt/include/tvm/runtime/crt/internal/aot_executor/aot_executor.h"
. Which we don’t have:So it’s a question for me. What is
tvmgen_default___tvm_main__()
function. We can find a reminding here and find in our model’s libs.src/model/default_lib0.c
In demo: lib.
We can compile with
generate_project.py
. But it will be have same result.Flags for compiling .tflite model, I take from this tutorial.
Also I try to install TVM 0.8.0 and 0.9.0 version.
At 0.8.0 version I had problem with python setup:
At 0.9.0 version I had a following problem, when creating project:
I need a file (launch_microtvm_api_server.sh), which appears only in 0.12.0 version. I don’t know why, to be honest.
Also my discussion on TVM.