logo

OpenMV N6 使用 AI 云训练 YOLOv8 模型报错

2026-05-19 13:01
V
vawp4eemlkfj

OpenMV N6 使用 AI 云训练 YOLOv8 模型报错

故障概述

在最新版 OpenMV IDE 与固件(v4.8.1)环境下,使用 OpenMV N6 摄像头,在 Singtown AI 云平台训练并导出 YOLOv8 目标检测模型(.tflite),将模型文件放入 U 盘后运行示例代码时出现报错。

关键信息

  • 故障类型:代码报错
  • 硬件型号:OpenMV N6(非标准型号,属‘其他’类别)
  • 固件版本:4.8.1
  • 参考文档:[Singtown AI 平台使用指南](https://singtown.com/cn/ai)

复现代码

import csi
import time
import ml
from ml.postprocessing.ultralytics import YoloV8

# Initialize the sensor.
csi0 = csi.CSI()
csi0.reset()
csi0.pixformat(csi.RGB565)
csi0.framesize(csi.VGA)
csi0.window((416, 416))

# Load YOLO V8 model from ROM FS.
model = ml.Model("/rom/trained.tflite", postprocess=YoloV8(threshold=0.4))
print(model)

# Visualization parameters.
n = len(model.labels)
model_class_colors = [(int(255 *i // n), int(255 *(n - i - 1) // n), 255) for i in range(n)]

clock = time.clock()
while True:
    clock.tick()
    img = csi0.snapshot()

    # boxes is a list of list per class of ((x, y, w, h), score) tuples
    boxes = model.predict([img])

    # Draw bounding boxes around the detected objects
    for i, class_detections in enumerate(boxes):
        rects = [r for r, score in class_detections]
        for rect in rects:
            img.draw_rectangle(rect)
        labels = [model.labels[i] for j in range(len(rects))]
        colors = [model_class_colors[i] for j in range(len(rects))]
        ml.utils.draw_predictions(img, rects, labels, colors, format=None)

    print(clock.fps(), "fps")

附件

image
image
image
2026-05-19 14:11
Z
星小瞳xs

更新5.0固件, IDE更新到4.8.10 然后按照流程即可:OpenMV Cam 5.0固件地址:Releases · openmv/openmv 4.8.10IDE地址:Releases · openmv/openmv-ide

image.png
2026-05-20 16:21
U
ustqx7grxrfw

Exception: Failed to load "trained.tflite", did you copy the .tflite and labels.txt file onto the mass-storage device? ([Errno 19] ENODEV)

2026-05-20 16:42
Z
星小瞳xs

提供代码,和报错图片(全屏截图)

2026-05-20 17:37
V
vawp4eemlkfj
image.png
V
vawp4eemlkfj

最新的ide也报错

Z
星小瞳xs

你没有更新5.0的固件

2026-05-20 17:57
V
vawp4eemlkfj
image.png
V
vawp4eemlkfj

固件刚刚更新的,也报错

2026-05-20 18:21
V
vawp4eemlkfj

你好,我固件和ide已经是最新的了,并且也按照你提供的部署opencCam的文章步骤去做,但编译romfs时候出现的报错,我模型是成功的

,并且是重新下载我在云服务的模型

V
vawp4eemlkfj
image.png
V
vawp4eemlkfj
image.png
V
vawp4eemlkfj

😭

2026-05-21 10:02
Z
星小瞳xs

看一下IDE的版本,然后使用的时候关掉Windows 安全中心的智能应用控制

2026-05-21 16:53
V
vawp4eemlkfj

IDE是最新的,我电脑的windows安全中心的智能应用控制是已经关闭状态

V
vawp4eemlkfj
image.png
V
vawp4eemlkfj

IDE是4.8.10

2026-05-21 17:56
Z
星小瞳xs

中文路径,你的模型不能是中文路径