How to change input shape in KL630

I converted the 3D-CNN model to nef and download to the KL 630 board.


This 3D-CNN model (video classification) image has a input with Height: 128, Width: 128, Channel: 3 (RGB), and fps: 15.


and I converted successfully with this code in Kneron Docker enviroment.


But the input from camera in KL630 is different from the converted nef model.

[0] [dim] Input 0 Row: 128

[0] [dim] Input 0 Col: 15  ->128

[0] [dim] Input 0 Channel: 128  ->3

[0] [postproc] Output num: 1 ->3


I want to change the Input 0 Col 15 to 128, Input 0 Channel: 128 to 3, Output num:1 to 3

How can I proceed it?


Before converted the nef, the onnx input information is following figure.


converted from model_3DCNN_LeaklyRelu4_128.tflite


name: serving_default_conv3d_input:0

tensor: float32[unk__106,128,128,15,3]






I attached the log file from serial communication.

Comments

  • Hi,

    Seeing from the image of the model, it seems like the input shape is dynamic: (unk__106, 128, 128, 15, 3). Unfortunately, none of our devices support dynamic input shape, so you would need to edit the model so that the input shape is fixed.

    For example:

    Not supported format: (unk_32, 32, 32, 3) (the input shape is not fixed and the channel goes last)

    Supported format: (1, 3, 32, 32) (the input shape is fixed and the channel goes first)

  • Thank you for your reply. How can I edit the dynamic input shape ?? Is there a reference??

    Maybe I should change through something related to onnx model.

    Thank you.

  • Hi,

    You can edit the dynamic input shape by using --overwrite-input-shapes parameter inside Kneronnxopt in our Kneron Toolchain:

    Here is the reference link: Kneronnxopt - Document Center

    I hope it helps.

The discussion has been closed due to inactivity. To continue with the topic, please feel free to post a new discussion.