Problem translating mobilnetv3 onnx model to DRP-AI format.

Compare input/output shape definition in ONNX and pre/post YAML file. Warning YAML defined size(input_to_body) is different from ONNX's size definition. -> Size defined in YAML file will be used. name: inputs:0 ONNX size : [1, 224, 224, 3] YAML size : [1, 3, 224, 224] Note: Both size are adjusted in NCHW(or NC) order to compare. YAML definition is HWC(or C) order. This may cause size inconsistency between input and output. After shape calculation, tool will check consistency. Error Possible error cause: 1. Error in prepost YAML definition file 2. Other cause... Internal error message: onnxruntime.capi.onnxruntime_pybind11_state.Fail: [ONNXRuntimeError] : 1 : FAIL : Node (StatefulPartitionedCall/StatefulPartitionedCall/predict/MobilenetV3/Logits/Squeeze) Op (Squeeze) [ShapeInferenceError] Dimension of input 2 must be 1 instead of -5

Mobilenetv3 is converted from saved model to ONNX(opset 11), but for some reason it does not translate to DRP-AI.

prepost file:

####################################### # Input data ####################################### input_to_pre: - name: "pre_in" format: "RGB" order: "HWC" shape: [480, 640, 2] type: "uint8" input_to_body: - name: "inputs:0" format: "RGB" order: "HWC" shape: [224, 224, 3] type: "fp16" ####################################### # Output data ####################################### output_from_body: - name: "logits" shape: [1000] order: "C" type: "fp16" output_from_post: - name: "post_out" shape: [1000] order: "C" type: "fp32" ####################################### # Preprocess ####################################### preprocess: - src: ["pre_in"] shape_in: [[480, 640, 2]] dtype_in: ["uint8"] dorder_in: ["HWC"] dest: ["inputs:0"] shape_out: [[224, 224, 3]] dtype_out: ["fp16"] dorder_out: ["HWC"] operations: #- # op: conv_yuv2rgb # shape_in: [[480, 640, 2]] # dtype_in: ["uint8"] # dorder_in: ["HWC"] # shape_out: [[480, 640, 3]] # dtype_out: ["uint8"] # dorder_out: ["HWC"] # param: # DOUT_RGB_FORMAT: 0 - op: resize_hwc shape_in: [[480, 640, 3]] dtype_in: ["uint8"] dorder_in: ["HWC"] shape_out: [[224, 224, 3]] dtype_out: ["uint8"] dorder_out: ["HWC"] param: RESIZE_ALG: 1 DATA_TYPE: 0 shape_out: [224, 224] - op: cast_any_to_fp16 shape_in: [[224, 224, 3]] dtype_in: ["uint8"] dorder_in: ["HWC"] shape_out: [[224, 224, 3]] dtype_out: ["fp16"] dorder_out: ["HWC"] param: DIN_FORMAT: 0 - op: normalize shape_in: [[224, 224, 3]] dtype_in: ["fp16"] dorder_in: ["HWC"] shape_out: [[224, 224, 3]] dtype_out: ["fp16"] dorder_out: ["HWC"] param: DOUT_RGB_ORDER: 0 cof_add: [-123.675, -116.28, -103.53] cof_mul: [0.01712475, 0.017507, 0.01742919] ####################################### # Postprocess ####################################### postprocess: - src: ["logits"] shape_in: [[1000]] dtype_in: ["fp16"] dorder_in: ["C"] dest: ["post_out"] shape_out: [[1000]] dtype_out: ["fp32"] dorder_out: ["C"] operations: - op : softmax shape_in: [[1000]] dtype_in: ["fp16"] dorder_in: ["C"] shape_out: [[1000]] dtype_out: ["fp32"] dorder_out: ["C"] param: DOUT_FORMAT: 1

Parents Reply Children