-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ESP-DL Quant Tool | TVM conversion & deployment on ESP32S3-EYE (AIV-675) #152
Comments
I got an other version of MobilenetV2 actually converting using the TVM tool. But after flashing my ESP32S3-EYE i get the following error:
The model is based on: https://github.com/Seeed-Studio/sscma-model-zoo/blob/main/docs/en/Person_Classification_MobileNetV2_0.35_Rep_96.md where i downloaded the ONNX file and exported it with ESP-DL TVM. I wonder why this happens even if the TVM export worked. |
The final error in the first version of MobilenetV2 is the native interface of TVM, which may be due to the model structure not being adapted. The issue of second version of MobilenetV2 is strange. You can try this commit first to see if it can solve your problem: 97e1c52 in https://github.com/espressif/esp-dl.git. In addition, the support for TVM in ESP-DL is not very mature, and there may be exceptions in the deployment of some custom models. Moreover, the main branch of TVM has undergone significant updates, so this implementation needs to be refactored. However, due to our current manpower constraints, we won't start the refactoring work in the short term; we need to complete other tasks first. So if any exceptions occur, you may need to handle them on your own in the short term. Sorry for the inconvenience. |
Recently I am working with ESP-DL Quantization Tool and TVM. I am trying to build different models and try to deploy them to the ESP32S3-EYE.
Creating several simple models works in most cases with the quantization tool, but rarely with TVM.
While comparing simple model like this:
My tests are using a static dummy image with the correct shape.
Using the Quantization Tool: ~113122 us
Using TVM: ~680491 us
Overall the performance of TVM, seams to be very inefficient for me right now. In most of these szenarios with "large" Models, TVM needs a large amount of memory. To fix the overflow in the .dram0.bss segment, I already moved the data to the PSRAM. (using EXT_RAM_BSS_ATTR and the necessary menuconfig ind the esp-idf)
What I want to do is Transfer learning with MobileNetV2. Building and train it with TF and converting it to ONNX isn't a problem. But somehow the conversions given with the ESP-DL Tools (Quant and TVM) is one. I understand that using the quantization tool won't be able to convert MobileNetV2 due to the missing layers, that are not implemented yet (ESP-DL Layers)
But using the TVM method leads to errors by using
esp-dl/tools/tvm/export_onnx_model.py
.My Transfer learning dummy model looks like this:
Exporting it to ONNX looks like this:
python -m tf2onnx.convert --saved-model tmp_model --output {model_name} --opset {opset}
For building a model i use a seperate google colab notebook.
The versions I use:
As a test I tried the TVM export by using different opsets (10-15). But the error looks for every version the same.
My colab notebook for the TVM export is based on #139.
The resulting error looks like this:
My goal is to compare these tools from Espressif directly with TF Lite micro or with models that are build with EdgeImpulse.
I wonder if somebody tried the same and faced similar issues.
I would be very happy about any kind of advice and support.
The text was updated successfully, but these errors were encountered: