MaixPy-v1 icon indicating copy to clipboard operation
MaixPy-v1 copied to clipboard

sipeed_kpu_get_output_err when running the KPU Operational feature map example

Open mentarus opened this issue 4 years ago • 0 comments

Was trying to get the example on https://maixpy.sipeed.com/en/libs/Maix/kpu.html

Flashed the model listed with kflash 1.6 but getting sipeed_kpu_get_output_err with MaixPyIDE 0.2.5.

import sensor
import image
import lcd
import KPU as kpu
index=3  
lcd.init()
sensor.reset()
sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(sensor.QVGA)
sensor.run(1)
task=kpu.load(0x300000)
img=image.Image()
info=kpu.netinfo(task)
layer=info[index]
w=layer.wo()
h=layer.ho()
num=int(320*240/w/h)
list=[None]*num
x_step=int(320/w)
y_step=int(240/h)
img_lcd=image.Image()
while True:
    img=sensor.snapshot()
    fmap=kpu.forward(task,img,index)
    for i in range(0,num):
        list[i]=kpu.fmap(fmap,i)
    for i in range(0,num):
        list[i].stretch(64,255)
    for i in range(0,num):
        a=img_lcd.draw_image(list[i],((i%x_step)*w,(int(i/x_step))*h))
       lcd.display(img_lcd)
       kpu.fmap_free(fmap)

Would appreciate help in how to debug what the issue is!

mentarus avatar Jan 21 '21 07:01 mentarus