Yolov8.2.0导出的best_int8.tflite在安卓Flutter框架中无法检测出目标,不知道是咋回事?

AccessZHB 2025-04-02 10:18:00
from ultralytics import YOLO
 
# Load a model
# model = YOLO("yolo11n.pt")  # load an official model
# model = YOLO("./runs/train/exp2/weights/best.pt")  # load a custom trained model
model = YOLO("./runs/train/exp9/weights/best.pt")
# Export the model
model.export(format="tflite",half=True,int8=True,imgsz=320,device=0,nms=True,opset=17,simplify=True,batch=1)

导出在终端打印的日志:

Ultralytics YOLOv8.2.0 🚀 Python-3.9.21 torch-2.1.0+cu118 CUDA:0 (NVIDIA GeForce RTX 3060, 12288MiB)
Model summary (fused): 168 layers, 3006038 parameters, 0 gradients, 8.1 GFLOPs

PyTorch: starting from 'runs\train\exp9\weights\best.pt' with input shape (1, 3, 320, 320) BCHW and output shape(s) (1, 6, 2100) (5.9 MB)

TensorFlow SavedModel: starting export with tensorflow 2.13.1...

ONNX: starting export with onnx 1.14.0 opset 17...
ONNX: simplifying with onnxsim 0.4.36...
ONNX: export success ✅ 0.8s, saved as 'runs\train\exp9\weights\best.onnx' (11.6 MB)
TensorFlow SavedModel: starting TFLite export with onnx2tf 1.17.5...

Automatic generation of each OP name started ========================================
Automatic generation of each OP name complete!

Model loaded ========================================================================

Model conversion started ============================================================
saved_model output started ==========================================================
saved_model output complete!
Float32 tflite output complete!
Float16 tflite output complete!
Input signature information for quantization
signature_name: serving_default
input_name.0: images shape: (1, 320, 320, 3) dtype: <dtype: 'float32'>
Dynamic Range Quantization tflite output complete!
fully_quantize: 0, inference_type: 6, input_inference_type: FLOAT32, output_inference_type: FLOAT32
INT8 Quantization tflite output complete!
fully_quantize: 0, inference_type: 6, input_inference_type: INT8, output_inference_type: INT8
Full INT8 Quantization tflite output complete!
INT8 Quantization with int16 activations tflite output complete!
Full INT8 Quantization with int16 activations tflite output complete!
TensorFlow SavedModel: export success ✅ 96.7s, saved as 'runs\train\exp9\weights\best_saved_model' (38.4 MB)

TensorFlow Lite: starting export with tensorflow 2.13.1...
TensorFlow Lite: export success ✅ 0.0s, saved as 'runs\train\exp9\weights\best_saved_model\best_int8.tflite' (3.0 MB)

Export complete (97.4s)
Results saved to E:\ultralytics\ultralytics-8.2.0\runs\train\exp9\weights
Predict:         yolo predict task=detect model=runs\train\exp9\weights\best_saved_model\best_int8.tflite imgsz=320 int8
Validate:        yolo val task=detect model=runs\train\exp9\weights\best_saved_model\best_int8.tflite imgsz=320 data=./data.yaml int8
Visualize:       https://netron.app

请哪位有经验的大佬,帮忙给出一些建议,多谢。 

...全文
639 回复 打赏 收藏 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复
详情可查看下方数据集可视化效果。 【数据集概况】 · 检测类别(中文):[自行车(bicycle), 汽车(car), 牛(cow), 鹅(goose), 马(horse), 人(human), 摩托车(motorbike), 羊(sheep), 危险标志(ss danger), 左转标志(ss left), 禁止鸣笛标志(ss no horn), 停车标志(ss parking), 右转标志(ss right), 停止标志(ss stop), 人行横道标志(ss xwalk), 绿灯(tl green), 关灯(tl off), 红灯(tl red), 黄灯(tl yellow)] · 训练集:1365 张 · 验证集:90 张 · 测试集:62 张 · 总计:1517 张 该数据集基于室内模拟交通场景构建,聚焦于交通标志、车辆及动物等目标的精准识别,为智能交通系统训练提供高质量样本,具有显著的行业应用价值与技术研究意义。训练集、验证集与测试集分别包含1365张、90张与62张图像,数据分布比例合理,训练集规模充足以保障模型学习充分,验证集与测试集用于模型性能评估,有效支撑模型迭代优化。所有目标均经过严格标注,边界框绘制精准,类别标注规范统一,无模糊或错误标注情况,确... 【训练曲线与评估图】 【模型训练配置】 参数 | 值 模型 | yolo26n 训练轮数 | 100 epochs 输入尺寸 | 640x640 批次大小 | 24 优化器 | auto 初始学习率 | 0.01 训练设备 【关键指标汇总】 训练了 41 个 epoch,最终轮指标: 指标 | 数值 mAP50 | **0.9644** mAP50-95 | 0.7193 Precision | 0.9278 Recall | 0.9049 train/box_loss | 0.8936 tra...

58,183

社区成员

发帖
与我相关
我的任务
社区描述
计算机视觉社区,旨在为CVer们提供优质的的内容和帮助,希望打造一个活跃优质的社区,欢迎加入~
人工智能计算机视觉深度学习 个人社区 辽宁省·大连市
社区管理员
  • 迪菲赫尔曼
  • 路人贾'ω'
  • GoAI
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧