我自己的服务器是训练的yolov5模型pt转换成onnx,再转换为kmodel,在k230上跑不起来,kmodel大小是7MB,用的是官方的示例代码,报错数组过大 有人遇到过这种情况吗,缩小输入尺寸也试过了没用
from libs.YOLO import YOLOv5
from libs.Utils import *
import os,sys,gc
import ulab.numpy as np
import image
if __name__=="__main__":
# 这里仅为示例,自定义场景请修改为您自己的测试图片、模型路径、标签名称、模型输入大小
img_path="/data/1_aug_10.jpg"
kmodel_path="/data/model/best.kmodel"
labels = ["1","2","3"]
model_input_size=[10,10]
confidence_threshold = 0.5
nms_threshold=0.45
img,img_ori=read_image(img_path)
rgb888p_size=[img.shape[2],img.shape[1]]
# 初始化YOLOv5实例
yolo=YOLOv5(task_type="detect",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,max_boxes_num=50,debug_mode=0)
yolo.config_preprocess()
res=yolo.run(img)
yolo.draw_result(res,img_ori)
yolo.deinit()
gc.collect()