增加模型转化和部署流程
This commit is contained in:
BIN
doc_attachments/2024-05-09T02-56-47-839Z.png
Normal file
BIN
doc_attachments/2024-05-09T02-56-47-839Z.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 23 KiB |
BIN
doc_attachments/2024-05-09T02-59-50-174Z.png
Normal file
BIN
doc_attachments/2024-05-09T02-59-50-174Z.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 27 KiB |
BIN
doc_attachments/2024-05-09T03-00-34-821Z.png
Normal file
BIN
doc_attachments/2024-05-09T03-00-34-821Z.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 32 KiB |
18
main.adoc
18
main.adoc
@@ -619,7 +619,25 @@ image::doc_attachments/2024-05-08T03-27-13-238Z.png[x-cube-ai 内核引擎]
|
||||
|
||||
===== X-CUBE-AI 模型转化和部署流程
|
||||
|
||||
由于集成在 STM32CubeMX 中,所以 X-CUBE-AI 的转化和部署流程自动化程度较高。基本步骤如下所述。
|
||||
|
||||
1. 导入使用特定框架生成的模型文件。本设计中使用 Keras 框架在 PC 上进行训练,导出格式为 `.h5df`。
|
||||
|
||||
2. 选择压缩等级/优化策略。由于采用权重/偏差压缩和操作融合的方式进行压缩,所以选择较大的压缩等级会导致模型精度产生损失。考虑到本设计中其他应用占用 flash 和 ram 空间不大,故选择 `Medium` 压缩等级,优化策略选择 `Balance`。
|
||||
|
||||
3. 进行分析作业,进行维度信息报告网络的预分析(系统集成角度)
|
||||
|
||||
4. 确认导入的模型结构和转化的 C 模型结构。测试过程中导入的模型结构和转化的 C 模型结构如下图。
|
||||
|
||||
5. 执行本地验证。启动所生成的 C 模型的验证过程。验证后生成的静态库参数如图所示。
|
||||
|
||||
6. 执行目标上验证。工具箱会生成验证固件并烧录至目标单片机,单片机循环运行推理流程,通过串口返回运行时性能。
|
||||
|
||||
image::doc_attachments/2024-05-09T03-00-34-821Z.png[导入的 Keras 模型结构]
|
||||
|
||||
image::doc_attachments/2024-05-09T02-59-50-174Z.png[转化后的 C 模型结构]
|
||||
|
||||
image::doc_attachments/2024-05-09T02-56-47-839Z.png[生成的静态库参数]
|
||||
|
||||
==== 基于 Modbus 总线协议的程序设计
|
||||
|
||||
|
||||
Reference in New Issue
Block a user