Closed wendemelb closed 2 years ago
Did you update the runtime?
I'm using this runtime https://github.com/kendryte/nncase/releases/download/v1.5.0/nncaseruntime-k210.zip
@windymelb Did you set compile_option.preprocess is TRUE?
@windymelb If you want to change input shape, you need to use this compile_options and set ptq options.
compile_options = nncase.CompileOptions()
compile_options.target = target
compile_options.input_type = 'uint8' # or 'uint8' 'int8'
compile_options.preprocess = True # if False, the args below will unworked
compile_options.swapRB = False
compile_options.input_shape = [1,240,320,3] # keep layout same as input layout
compile_options.input_layout = 'NHWC'
compile_options.output_layout = 'NHWC'
compile_options.mean = [0,0,0]
compile_options.std = [1,1,1]
compile_options.input_range = [0,1]
compile_options.letterbox_value = 114. # pad what you want
compile_options.dump_ir = True
compile_options.dump_asm = True
compile_options.dump_dir = 'tmp'
BTW if you change the input_shape, it will use letter_box function rather than Resize.
If any questions, reopen this issue.
When I compile and run the 20class_yolo_example on k210. It gives me an error.
============================================ LCD init system start [02m[..m/runtime_module.cpp:65 (shape_reg)] [0m[36mid < shaperegs.size()[0m = [01mfalse[0m ([32mbool[0m) error: Result too large
Code: https://github.com/kendryte/nncase/tree/master/examples/20classes_yolo/k210/kpu_20classes_example Model: https://github.com/kendryte/nncase/blob/master/examples/20classes_yolo/model/20classes_yolo.tflite Script: https://github.com/kendryte/nncase/blob/master/docs/USAGE_EN.md#compile-uint8-model-for-tflite I changed the input shape to [1,240,320,3] and added: compile_options.input_type = 'uint8'
Is something I did wrong? Could anyone give me the correct script that can compile this tflite model to kmodel? thanks.
Environment