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


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

Exception: Failed to load "trained.tflite", did you copy the .tflite and labels.txt file onto the mass-storage device? ([Errno 19] ENODEV)
提供代码,和报错图片(全屏截图)

最新的ide也报错
你没有更新5.0的固件

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


😭
看一下IDE的版本,然后使用的时候关掉Windows 安全中心的智能应用控制
IDE是最新的,我电脑的windows安全中心的智能应用控制是已经关闭状态

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