kendryte / kendryte-standalone-sdk

Standalone SDK for kendryte K210
https://kendryte.com
Apache License 2.0
445 stars 162 forks source link

kpu_run_kmodel: Result of model too large? #133

Open Myphos opened 3 years ago

Myphos commented 3 years ago

Expected behavior

I compiled a .tflite model with ncc 1.0.0-fec915fb and try to run it on K210. Unfortunately the model isn't running because the code fails with the following error message:

[..m/runtime_module.cpp:65 (shape_reg)] id < shape_regs_.size() = false (bool)
error: Result too large

The summary of the compiled model is

SUMMARY
INPUTS
0   new_input   u8[1,3,240,320]
OUTPUTS
0   Identity    f32[1,6300,6]

MEMORY USAGES
.input   225.00 KB  (230400 B)
.output  147.66 KB  (151200 B)
.data      2.93 MB  (3072000 B)
MODEL    402.77 KB  (412440 B)
TOTAL      3.69 MB  (3866040 B)

The model is fitting in the SRAM and I can initialize it with kpu_load_kmodel(&task, model_data_align) without error. After that I try to run it with kpu_run_kmodel(&task, g_ai_buf, DMAC_CHANNEL5, ai_done, NULL) but this functions results in the error message.

Test code

I attached the model (yolo.zip). I simply replaced the kmodel file in the 'kpu' example of kendryte-standalone-demo with my model.

At least the kpu_run_kmodel function should run without any errors, right? Or am I missing some limitation that I oversaw?

Git Versions

kendryte-standalone-sdk: 02576ba kendryte-standalone-demo: e89c354

Hardware

I'm using a Maixduino with OV2640 camera and the default display.

txx-899 commented 2 years ago

Have you solved it? I have the same problem

junze6 commented 2 years ago

Have you solved it? I have the same problem

zhen8838 commented 2 years ago

@junze6 更新sdk的runtime了吗,要把你现在用的nncase版本对应的runtime copy到sdk中, 参考这里.