My problem about load kmodel file



  • Firstly, I have used kflash tool to download the kfpkg file to my maix dock development board. The screen shot of my flash-list.json file and kflash setting are shown as follow:
    0_1581865991287_566973bf-6491-4308-baea-1ae07850d9eb-image.png
    0_1581866189576_02a53ffd-af50-45d3-adf6-7758c5497389-image.png
    As you can see, the kmodel file has been burned into the address 0x600000 and the size of m.kmodel file is 208072 bytes
    0_1581866370429_2a7c5b1b-4797-4ac5-a691-adea8ece463f-image.png

    Then I wrote the testing code to test whether kpu can load this model:(That is a part of my code)
    0_1581866838983_d0caef26-7f3c-460f-8633-cfd4e317c4b0-image.png

    But when compiled it and run it in my board, the screen display that "model init error" as below:
    ![0_1581869135758_b788e0b2-aafe-4536-867c-2c8607b69e36-图片.png](Uploading 100%)

    It seem that something is wrong, so i have entered the kpu_load_model function and i found that there are some if function in parallel:
    0_1581867321701_3e36258d-e140-418e-93c1-ee94678723d1-image.png

    So may be the version of my model is wrong, so i add a print function and printed it in my screen:
    0_1581867601766_8f0ab41e-de2e-4c09-86a0-c261913ce123-image.png
    ![0_1581869151038_25376080-9324-402c-a4cb-8f7491506f0b-图片.png](Uploading 100%)

    That's all my attempts, what's wrong with my process or code ? Thank you!



  • Model init error is due to newer Kmodel version being produced by nncase.

    kpu.c which is in released SDK 0.5.6 doesn't support it. you need latest SDK for running the new models.

    Use latest development version from Github



  • There are some photo cannot be uploaded after serveral times attempt.
    So in the first time, the screen display that the model init error
    And in the second time, the screen display that the version of model is 50331648
    I don't know why the version of my model is so large.
    Can you help me? Thank you so much..