k230执行yolov11分割任务显示“MPY: soft reboot”

Viewed 168

重现步骤

from libs.YOLO import YOLO11
from libs.Utils import *
import os,sys,gc
import ulab.numpy as np
import image

if name=="main":
# 这里仅为示例,自定义场景请修改为您自己的测试图片、模型路径、标签名称、模型输入大小
img_path="/data/xia.png"
kmodel_path="/data/best.kmodel"
labels = ["apple","banana","orange"]
model_input_size=[320,320]

confidence_threshold = 0.5
nms_threshold=0.45
mask_threshold=0.5
img,img_ori=read_image(img_path)
rgb888p_size=[img.shape[2],img.shape[1]]
# 初始化YOLO11实例
yolo=YOLO11(task_type="segment",mode="image",kmodel_path=kmodel_path,labels=labels,rgb888p_size=rgb888p_size,model_input_size=model_input_size,conf_thresh=confidence_threshold,nms_thresh=nms_threshold,mask_thresh=mask_threshold,max_boxes_num=50,debug_mode=0)
yolo.config_preprocess()
res=yolo.run(img)
yolo.draw_result(res,img_ori)
yolo.deinit()
gc.collect()

错误日志

MPY: soft reboot
CanMV v1.2.2(based on Micropython e00a144) on 2025-06-25; k230_canmv_01studio with K230

1 Answers

这是正常打印。。。

但是请问为什么没有看到图片分割的输出结果呢?

可能是模型不行,没有检测到框

换了一个模型,显示RuntimeError: memory allocation failed,请问如何解决呢