⚖️模型量化
在“模型训练”章节,讲解了如何训练一个yolov8模型,但是为了部署在Grove Vision V2上,我们还需要进一步对模型进行量化。本节内容如下:
Last updated
Was this helpful?
在“模型训练”章节,讲解了如何训练一个yolov8模型,但是为了部署在Grove Vision V2上,我们还需要进一步对模型进行量化。本节内容如下:
Last updated
Was this helpful?
Was this helpful?
pip install ultralytics
pip install tensorflowyolo export model=${your model path} format=tflite imgsz=192 int8pip3 install ethos-u-vela
; file: my_vela_cfg.ini ; -----------------------------------------------------------------------------
; Vela configuration file ; -----------------------------------------------------------------------------
; System Configuration
; My_Sys_Cfg
[System_Config.My_Sys_Cfg]
core_clock=400e6
axi0_port=Sram
axi1_port=OffChipFlash
Sram_clock_scale=1.0
Sram_burst_length=32
Sram_read_latency=16
Sram_write_latency=16
Dram_clock_scale=0.75
Dram_burst_length=128
Dram_read_latency=500
Dram_write_latency=250
OnChipFlash_clock_scale=0.25
OffChipFlash_clock_scale=0.015625
OffChipFlash_burst_length=32
OffChipFlash_read_latency=64
OffChipFlash_write_latency=64
; -----------------------------------------------------------------------------
; Memory Mode
; My_Mem_Mode_Parent
[Memory_Mode.My_Mem_Mode_Parent]
const_mem_area=Axi1
arena_mem_area=Axi0
cache_mem_area=Axi0vela --accelerator-config ethos-u55-64 --config vela_config.ini --system-config My_Sys_Cfg --memory-mode My_Mem_Mode_Parent --output-dir ${Save path of the optimized model} ${The path of the tflite model that needs to be optimized}