logo

星瞳AI视觉模组部署AI模型后闪退重连

2026-07-12 17:43
I
i1834yh0uhpy

星瞳AI视觉模组部署AI模型后闪退重连

故障概述

部署AI模型后出现闪退重连现象。

故障类型

  • 硬件故障

硬件信息

  • 产品型号:其他(非标准OpenMV系列)
  • 固件版本:4.8.1

故障现象

  • 运行部署的AI模型时发生闪退并自动重连

相关代码

import sensor
import time
import ml

sensor.reset() # Reset and initialize the sensor.
sensor.set_pixformat(sensor.RGB565) # Set pixel format to RGB565 (or GRAYSCALE)
sensor.set_framesize(sensor.QVGA) # Set frame size to QVGA (320x240)
sensor.set_windowing((240, 240)) # Set 240x240 window.
sensor.skip_frames(time=2000) # Let the camera adjust.

model = ml.Model("/rom/trained.tflite", load_to_fb=True)
labels = model.labels
norm = ml.Normalization(scale=(-1.0, 1.0))

clock = time.clock()
while True:
    clock.tick()
    img = sensor.snapshot()
    input = [norm(img)] # scale 0~~255 to -1.0~~1.0
    scores = model.predict(input)[0].flatten().tolist()
    for label, score in zip(labels, scores):
        print(label, score)
    print(clock.fps(), "fps")

参考链接

无

硬件图片

image
image
2026-07-13 12:29
Z
星小瞳xs

提供IDE版本和固件版本