资料
dtop
Jetson有Jtop,Linux有Htop,RDK也有Dtop! - 板卡使用 - 地瓜机器人论坛
模型量化
首先准备yolov11模型
转onnx
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| from ultralytics import YOLO
pt_file = "best.pt"
model = YOLO(pt_file)
model.export( format="onnx", imgsz=640, batch=1, opset=11, dynamic=False, simplify=True, nms=False, device="cpu" )
print(f"✅ YOLOv11 ONNX 已生成: {pt_file.replace('.pt', '.onnx')}")
|
hb_compile算子检测
使用hb_compile检测BPU算子支持,S100 用 nash-e,S100P 用 nash-m
1 2 3 4
| hb_compile \ --march nash-e \ --model ./best.onnx \ --input-shape images 1x3x640x640
|


hb_compile量化工具
直接量化,快速性能评测模式(开启fast-perf),会转为int8-NV12模型
1 2 3 4
| hb_compile --fast-perf \ --model /open_explorer/data/best.onnx \ --march nash-m \ --input-shape images 1x3x640x640
|

自定义量化细节
创建yolo11_quantize.yaml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| 编辑
model_parameters: onnx_model: "best.onnx" march: "nash-m" output_model_file_prefix: "yolo11_bgr" working_dir: "./model_output"
input_parameters: input_name: "images" input_type_train: "bgr" input_type_rt: "bgr" input_layout_train: "NCHW" input_shape: "1x3x640x640" mean_value: "0 0 0" scale_value: "0.003921568627451"
compiler_parameters: compile_mode: "latency" core_num: 1 optimize_level: "O2"
|
