Write Model To Flash

1. Introduction

The inference model must be loaded into Kneron AI device before the inference process.

There are two ways to load models:

Note: Only one model file (.nef) can be loaded, no matter it was uploaded via USB or loaded from flash. If you want to change the model, please reboot the Kneron AI device.

Note: Upload model via USB can be directly used without writting model into flash.


2. Download Kneron DFUT

Download the KneronDFUT_ubuntu.zip into Ubuntu from https://www.kneron.com/tw/support/developers/. It is located at Kneron PLUS section.

$ unzip KneronDFUT_ubuntu.zip
$ cd Kneron_DFUT/bin/

Show help message

$ sudo ./KneronDFUT --help


3. Write Model Into KL520

3.1 Use GUI to Write Model into AI Device

$ sudo ./KneronDFUT
  1. Select KL520 Tab.

  2. Select the KL520 dongles to write model into.

  3. Select Update Model to Flash

  4. Manually choose Model file.

  5. Push Run button.

3.2 Use Command Line to Write Model into AI Device

  1. List all dongles

    $ sudo ./KneronDFUT --list
    
    ===========================================
    Index:          1
    Port Id:        133
    Kn Number:      0x270A265C
    Device Type:    KL520
    FW Type:        KDP
    Usb Speed:      High-Speed
    Connectable:    true
    ===========================================
    
  2. Write model into the selected KL520 dongles using the port id

    $ sudo ./KneronDFUT --model-to-flash ${MODEL_FILE_PATH} --port 133 -- type KL520
    
    Start Update Model to Device with Port Id 133
    
    ==== Update Model to Device with Port Id: 133 Succeeded ====
    

4. Write Model Into KL720

4.1 Use GUI to Write Model into AI Device

$ sudo ./KneronDFUT
  1. Select KL720 Tab.

  2. Select the KL720 dongles to write model into.

  3. Select Update Model to Flash

  4. Manually choose Model file.

  5. Push Run button.

4.2 Use Command Line to Write Model into AI Device

  1. List all dongles

    $ sudo ./KneronDFUT --list
    
    ===========================================
    Index:          1
    Port Id:        262
    Kn Number:      0x2004142C
    Device Type:    KL720
    FW Type:        KDP
    Usb Speed:      Super-Speed
    Connectable:    true
    ===========================================
    
  2. Write model into the selected KL720 dongles using the port id

    $ sudo ./KneronDFUT --model-to-flash ${MODEL_FILE_PATH} --port 262 --type KL720
    
    Start Update Model to Device with Port Id 262
    
    ==== Update Model to Device with Port Id: 262 Succeeded ====