Forums - Mismatch between size of input model and width of weight matrix

3 posts / 0 new
Last post
Mismatch between size of input model and width of weight matrix
aisraeli
Join Date: 13 Jan 22
Posts: 2
Posted: Sun, 2022-01-30 23:30

Hi,

I converted a model whose architecuture Mobilenet+last layer as dense layer with 10 units.

The conversion process was from keras to onnx to dlc. I'm using SNPE version 1.56.2.3050.

During the conversion I got the following warning messages:

2022-01-30 13:35:03,013 - 219 - WARNING - WARNING_GEMM: GEMM operation is not supported in the general case, attempting to interpret as FC

2022-01-30 13:35:03,127 - 214 - INFO - INFO_DLC_SAVE_LOCATION: Saving model at mobilenet_weights_224.dlc

/snpe-1.56.2.3050/lib/python/qti/aisw/converters/backend/ir_to_dlc.py:877: RuntimeWarning: info_code=1004; message=Layer parameters combination is invalid. Layer model/dense/MatMul_Gemm__6: mismatch between size of input model/global_average_pooling2d/Mean:0_model/global_average_pooling2d/Mean_Squeeze__225.ncs (1024) and width of weight matrix (10); component=Model Validation; line_no=1588; thread_id=140266431653696

  node.output_names[0])

2022-01-30 13:35:03,217 - 214 - INFO - INFO_CONVERSION_SUCCESS: Conversion completed successfully

When I tried to build an snpe object, I got a similar error at the model validation part:

error_code=1004; error_message=Layer parameters combination is invalid. error_code=1004; error_message=Layer parameters combination is invalid. Layer model/dense/MatMul_Gemm__6: mismatch between size of input model/global_average_pooling2d/Mean:0_model/global_average_pooling2d/Mean_Squeeze__225.ncs (1024) and width of weight matrix (10); error_component=Model Validation; line_no=1533; thread_id=522626589936; error_component=Model Validation; line_no=262; thread_id=522646467912      

Just to mention that the keras and onnx model runs fine in Python.

I noticed your supported onnx ops list:

https://developer.qualcomm.com/sites/default/files/docs/snpe/supported_o...

Where it is said that Gemm is only supported in the case it used to emulate FC.

The model archituecture (keras model.summary() output):

_________________________________________________________________
 Layer (type)                Output Shape              Param #   
=================================================================
 input_1 (InputLayer)        [(1, 224, 224, 3)]        0         
                                                                 
 conv1 (Conv2D)              (None, None, None, 32)    864       
                                                                 
 conv1_bn (BatchNormalizatio  (None, None, None, 32)   128       
 n)                                                              
                                                                 
 conv1_relu (ReLU)           (None, None, None, 32)    0         
                                                                 
 conv_dw_1 (DepthwiseConv2D)  (None, None, None, 32)   288       
                                                                 
 conv_dw_1_bn (BatchNormaliz  (None, None, None, 32)   128       
 ation)                                                          
                                                                 
 conv_dw_1_relu (ReLU)       (None, None, None, 32)    0         
                                                                 
 conv_pw_1 (Conv2D)          (None, None, None, 64)    2048      
                                                                 
 conv_pw_1_bn (BatchNormaliz  (None, None, None, 64)   256       
 ation)                                                          
                                                                 
 conv_pw_1_relu (ReLU)       (None, None, None, 64)    0         
                                                                 
 conv_pad_2 (ZeroPadding2D)  (None, None, None, 64)    0         
                                                                 
 conv_dw_2 (DepthwiseConv2D)  (None, None, None, 64)   576       
                                                                 
 conv_dw_2_bn (BatchNormaliz  (None, None, None, 64)   256       
 ation)                                                          
                                                                 
 conv_dw_2_relu (ReLU)       (None, None, None, 64)    0         
                                                                 
 conv_pw_2 (Conv2D)          (None, None, None, 128)   8192      
                                                                 
 conv_pw_2_bn (BatchNormaliz  (None, None, None, 128)  512       
 ation)                                                          
                                                                 
 conv_pw_2_relu (ReLU)       (None, None, None, 128)   0         
                                                                 
 conv_dw_3 (DepthwiseConv2D)  (None, None, None, 128)  1152      
                                                                 
 conv_dw_3_bn (BatchNormaliz  (None, None, None, 128)  512       
 ation)                                                          
                                                                 
 conv_dw_3_relu (ReLU)       (None, None, None, 128)   0         
                                                                 
 conv_pw_3 (Conv2D)          (None, None, None, 128)   16384     
                                                                 
 conv_pw_3_bn (BatchNormaliz  (None, None, None, 128)  512       
 ation)                                                          
                                                                 
 conv_pw_3_relu (ReLU)       (None, None, None, 128)   0         
                                                                 
 conv_pad_4 (ZeroPadding2D)  (None, None, None, 128)   0         
                                                                 
 conv_dw_4 (DepthwiseConv2D)  (None, None, None, 128)  1152      
                                                                 
 conv_dw_4_bn (BatchNormaliz  (None, None, None, 128)  512       
 ation)                                                          
                                                                 
 conv_dw_4_relu (ReLU)       (None, None, None, 128)   0         
                                                                 
 conv_pw_4 (Conv2D)          (None, None, None, 256)   32768     
                                                                 
 conv_pw_4_bn (BatchNormaliz  (None, None, None, 256)  1024      
 ation)                                                          
                                                                 
 conv_pw_4_relu (ReLU)       (None, None, None, 256)   0         
                                                                 
 conv_dw_5 (DepthwiseConv2D)  (None, None, None, 256)  2304      
                                                                 
 conv_dw_5_bn (BatchNormaliz  (None, None, None, 256)  1024      
 ation)                                                          
                                                                 
 conv_dw_5_relu (ReLU)       (None, None, None, 256)   0         
                                                                 
 conv_pw_5 (Conv2D)          (None, None, None, 256)   65536     
                                                                 
 conv_pw_5_bn (BatchNormaliz  (None, None, None, 256)  1024      
 ation)                                                          
                                                                 
 conv_pw_5_relu (ReLU)       (None, None, None, 256)   0         
                                                                 
 conv_pad_6 (ZeroPadding2D)  (None, None, None, 256)   0         
                                                                 
 conv_dw_6 (DepthwiseConv2D)  (None, None, None, 256)  2304      
                                                                 
 conv_dw_6_bn (BatchNormaliz  (None, None, None, 256)  1024      
 ation)                                                          
                                                                 
 conv_dw_6_relu (ReLU)       (None, None, None, 256)   0         
                                                                 
 conv_pw_6 (Conv2D)          (None, None, None, 512)   131072    
                                                                 
 conv_pw_6_bn (BatchNormaliz  (None, None, None, 512)  2048      
 ation)                                                          
                                                                 
 conv_pw_6_relu (ReLU)       (None, None, None, 512)   0         
                                                                 
 conv_dw_7 (DepthwiseConv2D)  (None, None, None, 512)  4608      
                                                                 
 conv_dw_7_bn (BatchNormaliz  (None, None, None, 512)  2048      
 ation)                                                          
                                                                 
 conv_dw_7_relu (ReLU)       (None, None, None, 512)   0         
                                                                 
 conv_pw_7 (Conv2D)          (None, None, None, 512)   262144    
                                                                 
 conv_pw_7_bn (BatchNormaliz  (None, None, None, 512)  2048      
 ation)                                                          
                                                                 
 conv_pw_7_relu (ReLU)       (None, None, None, 512)   0         
                                                                 
 conv_dw_8 (DepthwiseConv2D)  (None, None, None, 512)  4608      
                                                                 
 conv_dw_8_bn (BatchNormaliz  (None, None, None, 512)  2048      
 ation)                                                          
                                                                 
 conv_dw_8_relu (ReLU)       (None, None, None, 512)   0         
                                                                 
 conv_pw_8 (Conv2D)          (None, None, None, 512)   262144    
                                                                 
 conv_pw_8_bn (BatchNormaliz  (None, None, None, 512)  2048      
 ation)                                                          
                                                                 
 conv_pw_8_relu (ReLU)       (None, None, None, 512)   0         
                                                                 
 conv_dw_9 (DepthwiseConv2D)  (None, None, None, 512)  4608      
                                                                 
 conv_dw_9_bn (BatchNormaliz  (None, None, None, 512)  2048      
 ation)                                                          
                                                                 
 conv_dw_9_relu (ReLU)       (None, None, None, 512)   0         
                                                                 
 conv_pw_9 (Conv2D)          (None, None, None, 512)   262144    
                                                                 
 conv_pw_9_bn (BatchNormaliz  (None, None, None, 512)  2048      
 ation)                                                          
                                                                 
 conv_pw_9_relu (ReLU)       (None, None, None, 512)   0         
                                                                 
 conv_dw_10 (DepthwiseConv2D  (None, None, None, 512)  4608      
 )                                                               
                                                                 
 conv_dw_10_bn (BatchNormali  (None, None, None, 512)  2048      
 zation)                                                         
                                                                 
 conv_dw_10_relu (ReLU)      (None, None, None, 512)   0         
                                                                 
 conv_pw_10 (Conv2D)         (None, None, None, 512)   262144    
                                                                 
 conv_pw_10_bn (BatchNormali  (None, None, None, 512)  2048      
 zation)                                                         
                                                                 
 conv_pw_10_relu (ReLU)      (None, None, None, 512)   0         
                                                                 
 conv_dw_11 (DepthwiseConv2D  (None, None, None, 512)  4608      
 )                                                               
                                                                 
 conv_dw_11_bn (BatchNormali  (None, None, None, 512)  2048      
 zation)                                                         
                                                                 
 conv_dw_11_relu (ReLU)      (None, None, None, 512)   0         
                                                                 
 conv_pw_11 (Conv2D)         (None, None, None, 512)   262144    
                                                                 
 conv_pw_11_bn (BatchNormali  (None, None, None, 512)  2048      
 zation)                                                         
                                                                 
 conv_pw_11_relu (ReLU)      (None, None, None, 512)   0         
                                                                 
 conv_pad_12 (ZeroPadding2D)  (None, None, None, 512)  0         
                                                                 
 conv_dw_12 (DepthwiseConv2D  (None, None, None, 512)  4608      
 )                                                               
                                                                 
 conv_dw_12_bn (BatchNormali  (None, None, None, 512)  2048      
 zation)                                                         
                                                                 
 conv_dw_12_relu (ReLU)      (None, None, None, 512)   0         
                                                                 
 conv_pw_12 (Conv2D)         (None, None, None, 1024)  524288    
                                                                 
 conv_pw_12_bn (BatchNormali  (None, None, None, 1024)  4096     
 zation)                                                         
                                                                 
 conv_pw_12_relu (ReLU)      (None, None, None, 1024)  0         
                                                                 
 conv_dw_13 (DepthwiseConv2D  (None, None, None, 1024)  9216     
 )                                                               
                                                                 
 conv_dw_13_bn (BatchNormali  (None, None, None, 1024)  4096     
 zation)                                                         
                                                                 
 conv_dw_13_relu (ReLU)      (None, None, None, 1024)  0         
                                                                 
 conv_pw_13 (Conv2D)         (None, None, None, 1024)  1048576   
                                                                 
 conv_pw_13_bn (BatchNormali  (None, None, None, 1024)  4096     
 zation)                                                         
                                                                 
 conv_pw_13_relu (ReLU)      (None, None, None, 1024)  0         
                                                                 
 global_average_pooling2d (G  (None, 1024)             0         
 lobalAveragePooling2D)                                          
                                                                 
 dense (Dense)               (None, 10)                10250     
                                                                 
=================================================================
Total params: 3,239,114
Trainable params: 0
Non-trainable params: 3,239,114
_________________________________________________________________
 
Onnx proto graph output:
[input: "input"
output: "model/conv1/Conv2D__7:0"
name: "model/conv1/Conv2D__7"
op_type: "Transpose"
attribute {
  name: "perm"
  ints: 0
  ints: 3
  ints: 1
  ints: 2
  type: INTS
}
, input: "model/conv1/Conv2D__7:0"
input: "model/conv1/Conv2D_weights_fused_bn"
input: "model/conv1/Conv2D_bias_fused_bn"
output: "model/conv1_bn/FusedBatchNormV3:0"
name: "model/conv1/Conv2D"
op_type: "Conv"
attribute {
  name: "dilations"
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "strides"
  ints: 2
  ints: 2
  type: INTS
}
attribute {
  name: "kernel_shape"
  ints: 3
  ints: 3
  type: INTS
}
attribute {
  name: "pads"
  ints: 0
  ints: 0
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "group"
  i: 1
  type: INT
}
, input: "model/conv1_bn/FusedBatchNormV3:0"
input: "model/conv_dw_3_relu/Relu6_min__51"
input: "model/conv_pw_4_relu/Relu6_max__74"
output: "model/conv1_relu/Relu6:0"
name: "model/conv1_relu/Relu6"
op_type: "Clip"
, input: "model/conv1_relu/Relu6:0"
input: "model/conv_dw_1/depthwise_weights_fused_bn"
input: "model/conv_dw_1/depthwise_bias_fused_bn"
output: "model/conv_dw_1_bn/FusedBatchNormV3:0"
name: "model/conv_dw_1/depthwise"
op_type: "Conv"
attribute {
  name: "dilations"
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "strides"
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "kernel_shape"
  ints: 3
  ints: 3
  type: INTS
}
attribute {
  name: "group"
  i: 32
  type: INT
}
attribute {
  name: "pads"
  ints: 1
  ints: 1
  ints: 1
  ints: 1
  type: INTS
}
, input: "model/conv_dw_1_bn/FusedBatchNormV3:0"
input: "model/conv_dw_3_relu/Relu6_min__51"
input: "model/conv_pw_4_relu/Relu6_max__74"
output: "model/conv_dw_1_relu/Relu6:0"
name: "model/conv_dw_1_relu/Relu6"
op_type: "Clip"
, input: "model/conv_dw_1_relu/Relu6:0"
input: "model/conv_pw_1/Conv2D_weights_fused_bn"
input: "model/conv_pw_1/Conv2D_bias_fused_bn"
output: "model/conv_pw_1_bn/FusedBatchNormV3:0"
name: "model/conv_pw_1/Conv2D"
op_type: "Conv"
attribute {
  name: "dilations"
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "strides"
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "kernel_shape"
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "pads"
  ints: 0
  ints: 0
  ints: 0
  ints: 0
  type: INTS
}
attribute {
  name: "group"
  i: 1
  type: INT
}
, input: "model/conv_pw_1_bn/FusedBatchNormV3:0"
input: "model/conv_dw_3_relu/Relu6_min__51"
input: "model/conv_pw_4_relu/Relu6_max__74"
output: "model/conv_pw_1_relu/Relu6:0"
name: "model/conv_pw_1_relu/Relu6"
op_type: "Clip"
, input: "model/conv_pw_1_relu/Relu6:0"
input: "pad_const__28"
output: "model/conv_pad_2/Pad:0"
name: "model/conv_pad_2/Pad"
op_type: "Pad"
, input: "model/conv_pad_2/Pad:0"
input: "model/conv_dw_2/depthwise_weights_fused_bn"
input: "model/conv_dw_2/depthwise_bias_fused_bn"
output: "model/conv_dw_2_bn/FusedBatchNormV3:0"
name: "model/conv_dw_2/depthwise"
op_type: "Conv"
attribute {
  name: "dilations"
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "strides"
  ints: 2
  ints: 2
  type: INTS
}
attribute {
  name: "kernel_shape"
  ints: 3
  ints: 3
  type: INTS
}
attribute {
  name: "group"
  i: 64
  type: INT
}
, input: "model/conv_dw_2_bn/FusedBatchNormV3:0"
input: "model/conv_dw_3_relu/Relu6_min__51"
input: "model/conv_pw_4_relu/Relu6_max__74"
output: "model/conv_dw_2_relu/Relu6:0"
name: "model/conv_dw_2_relu/Relu6"
op_type: "Clip"
, input: "model/conv_dw_2_relu/Relu6:0"
input: "model/conv_pw_2/Conv2D_weights_fused_bn"
input: "model/conv_pw_2/Conv2D_bias_fused_bn"
output: "model/conv_pw_2_bn/FusedBatchNormV3:0"
name: "model/conv_pw_2/Conv2D"
op_type: "Conv"
attribute {
  name: "dilations"
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "strides"
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "kernel_shape"
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "pads"
  ints: 0
  ints: 0
  ints: 0
  ints: 0
  type: INTS
}
attribute {
  name: "group"
  i: 1
  type: INT
}
, input: "model/conv_pw_2_bn/FusedBatchNormV3:0"
input: "model/conv_dw_3_relu/Relu6_min__51"
input: "model/conv_pw_4_relu/Relu6_max__74"
output: "model/conv_pw_2_relu/Relu6:0"
name: "model/conv_pw_2_relu/Relu6"
op_type: "Clip"
, input: "model/conv_pw_2_relu/Relu6:0"
input: "model/conv_dw_3/depthwise_weights_fused_bn"
input: "model/conv_dw_3/depthwise_bias_fused_bn"
output: "model/conv_dw_3_bn/FusedBatchNormV3:0"
name: "model/conv_dw_3/depthwise"
op_type: "Conv"
attribute {
  name: "dilations"
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "strides"
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "kernel_shape"
  ints: 3
  ints: 3
  type: INTS
}
attribute {
  name: "group"
  i: 128
  type: INT
}
attribute {
  name: "pads"
  ints: 1
  ints: 1
  ints: 1
  ints: 1
  type: INTS
}
, input: "model/conv_dw_3_bn/FusedBatchNormV3:0"
input: "model/conv_dw_3_relu/Relu6_min__51"
input: "model/conv_pw_4_relu/Relu6_max__74"
output: "model/conv_dw_3_relu/Relu6:0"
name: "model/conv_dw_3_relu/Relu6"
op_type: "Clip"
, input: "model/conv_dw_3_relu/Relu6:0"
input: "model/conv_pw_3/Conv2D_weights_fused_bn"
input: "model/conv_pw_3/Conv2D_bias_fused_bn"
output: "model/conv_pw_3_bn/FusedBatchNormV3:0"
name: "model/conv_pw_3/Conv2D"
op_type: "Conv"
attribute {
  name: "dilations"
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "strides"
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "kernel_shape"
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "pads"
  ints: 0
  ints: 0
  ints: 0
  ints: 0
  type: INTS
}
attribute {
  name: "group"
  i: 1
  type: INT
}
, input: "model/conv_pw_3_bn/FusedBatchNormV3:0"
input: "model/conv_dw_3_relu/Relu6_min__51"
input: "model/conv_pw_4_relu/Relu6_max__74"
output: "model/conv_pw_3_relu/Relu6:0"
name: "model/conv_pw_3_relu/Relu6"
op_type: "Clip"
, input: "model/conv_pw_3_relu/Relu6:0"
input: "pad_const__28"
output: "model/conv_pad_4/Pad:0"
name: "model/conv_pad_4/Pad"
op_type: "Pad"
, input: "model/conv_pad_4/Pad:0"
input: "model/conv_dw_4/depthwise_weights_fused_bn"
input: "model/conv_dw_4/depthwise_bias_fused_bn"
output: "model/conv_dw_4_bn/FusedBatchNormV3:0"
name: "model/conv_dw_4/depthwise"
op_type: "Conv"
attribute {
  name: "dilations"
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "strides"
  ints: 2
  ints: 2
  type: INTS
}
attribute {
  name: "kernel_shape"
  ints: 3
  ints: 3
  type: INTS
}
attribute {
  name: "group"
  i: 128
  type: INT
}
, input: "model/conv_dw_4_bn/FusedBatchNormV3:0"
input: "model/conv_dw_3_relu/Relu6_min__51"
input: "model/conv_pw_4_relu/Relu6_max__74"
output: "model/conv_dw_4_relu/Relu6:0"
name: "model/conv_dw_4_relu/Relu6"
op_type: "Clip"
, input: "model/conv_dw_4_relu/Relu6:0"
input: "model/conv_pw_4/Conv2D_weights_fused_bn"
input: "model/conv_pw_4/Conv2D_bias_fused_bn"
output: "model/conv_pw_4_bn/FusedBatchNormV3:0"
name: "model/conv_pw_4/Conv2D"
op_type: "Conv"
attribute {
  name: "dilations"
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "strides"
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "kernel_shape"
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "pads"
  ints: 0
  ints: 0
  ints: 0
  ints: 0
  type: INTS
}
attribute {
  name: "group"
  i: 1
  type: INT
}
, input: "model/conv_pw_4_bn/FusedBatchNormV3:0"
input: "model/conv_dw_3_relu/Relu6_min__51"
input: "model/conv_pw_4_relu/Relu6_max__74"
output: "model/conv_pw_4_relu/Relu6:0"
name: "model/conv_pw_4_relu/Relu6"
op_type: "Clip"
, input: "model/conv_pw_4_relu/Relu6:0"
input: "model/conv_dw_5/depthwise_weights_fused_bn"
input: "model/conv_dw_5/depthwise_bias_fused_bn"
output: "model/conv_dw_5_bn/FusedBatchNormV3:0"
name: "model/conv_dw_5/depthwise"
op_type: "Conv"
attribute {
  name: "dilations"
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "strides"
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "kernel_shape"
  ints: 3
  ints: 3
  type: INTS
}
attribute {
  name: "group"
  i: 256
  type: INT
}
attribute {
  name: "pads"
  ints: 1
  ints: 1
  ints: 1
  ints: 1
  type: INTS
}
, input: "model/conv_dw_5_bn/FusedBatchNormV3:0"
input: "model/conv_dw_3_relu/Relu6_min__51"
input: "model/conv_pw_4_relu/Relu6_max__74"
output: "model/conv_dw_5_relu/Relu6:0"
name: "model/conv_dw_5_relu/Relu6"
op_type: "Clip"
, input: "model/conv_dw_5_relu/Relu6:0"
input: "model/conv_pw_5/Conv2D_weights_fused_bn"
input: "model/conv_pw_5/Conv2D_bias_fused_bn"
output: "model/conv_pw_5_bn/FusedBatchNormV3:0"
name: "model/conv_pw_5/Conv2D"
op_type: "Conv"
attribute {
  name: "dilations"
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "strides"
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "kernel_shape"
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "pads"
  ints: 0
  ints: 0
  ints: 0
  ints: 0
  type: INTS
}
attribute {
  name: "group"
  i: 1
  type: INT
}
, input: "model/conv_pw_5_bn/FusedBatchNormV3:0"
input: "model/conv_dw_3_relu/Relu6_min__51"
input: "model/conv_pw_4_relu/Relu6_max__74"
output: "model/conv_pw_5_relu/Relu6:0"
name: "model/conv_pw_5_relu/Relu6"
op_type: "Clip"
, input: "model/conv_pw_5_relu/Relu6:0"
input: "pad_const__28"
output: "model/conv_pad_6/Pad:0"
name: "model/conv_pad_6/Pad"
op_type: "Pad"
, input: "model/conv_pad_6/Pad:0"
input: "model/conv_dw_6/depthwise_weights_fused_bn"
input: "model/conv_dw_6/depthwise_bias_fused_bn"
output: "model/conv_dw_6_bn/FusedBatchNormV3:0"
name: "model/conv_dw_6/depthwise"
op_type: "Conv"
attribute {
  name: "dilations"
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "strides"
  ints: 2
  ints: 2
  type: INTS
}
attribute {
  name: "kernel_shape"
  ints: 3
  ints: 3
  type: INTS
}
attribute {
  name: "group"
  i: 256
  type: INT
}
, input: "model/conv_dw_6_bn/FusedBatchNormV3:0"
input: "model/conv_dw_3_relu/Relu6_min__51"
input: "model/conv_pw_4_relu/Relu6_max__74"
output: "model/conv_dw_6_relu/Relu6:0"
name: "model/conv_dw_6_relu/Relu6"
op_type: "Clip"
, input: "model/conv_dw_6_relu/Relu6:0"
input: "model/conv_pw_6/Conv2D_weights_fused_bn"
input: "model/conv_pw_6/Conv2D_bias_fused_bn"
output: "model/conv_pw_6_bn/FusedBatchNormV3:0"
name: "model/conv_pw_6/Conv2D"
op_type: "Conv"
attribute {
  name: "dilations"
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "strides"
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "kernel_shape"
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "pads"
  ints: 0
  ints: 0
  ints: 0
  ints: 0
  type: INTS
}
attribute {
  name: "group"
  i: 1
  type: INT
}
, input: "model/conv_pw_6_bn/FusedBatchNormV3:0"
input: "model/conv_dw_3_relu/Relu6_min__51"
input: "model/conv_pw_4_relu/Relu6_max__74"
output: "model/conv_pw_6_relu/Relu6:0"
name: "model/conv_pw_6_relu/Relu6"
op_type: "Clip"
, input: "model/conv_pw_6_relu/Relu6:0"
input: "model/conv_dw_7/depthwise_weights_fused_bn"
input: "model/conv_dw_7/depthwise_bias_fused_bn"
output: "model/conv_dw_7_bn/FusedBatchNormV3:0"
name: "model/conv_dw_7/depthwise"
op_type: "Conv"
attribute {
  name: "dilations"
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "strides"
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "kernel_shape"
  ints: 3
  ints: 3
  type: INTS
}
attribute {
  name: "group"
  i: 512
  type: INT
}
attribute {
  name: "pads"
  ints: 1
  ints: 1
  ints: 1
  ints: 1
  type: INTS
}
, input: "model/conv_dw_7_bn/FusedBatchNormV3:0"
input: "model/conv_dw_3_relu/Relu6_min__51"
input: "model/conv_pw_4_relu/Relu6_max__74"
output: "model/conv_dw_7_relu/Relu6:0"
name: "model/conv_dw_7_relu/Relu6"
op_type: "Clip"
, input: "model/conv_dw_7_relu/Relu6:0"
input: "model/conv_pw_7/Conv2D_weights_fused_bn"
input: "model/conv_pw_7/Conv2D_bias_fused_bn"
output: "model/conv_pw_7_bn/FusedBatchNormV3:0"
name: "model/conv_pw_7/Conv2D"
op_type: "Conv"
attribute {
  name: "dilations"
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "strides"
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "kernel_shape"
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "pads"
  ints: 0
  ints: 0
  ints: 0
  ints: 0
  type: INTS
}
attribute {
  name: "group"
  i: 1
  type: INT
}
, input: "model/conv_pw_7_bn/FusedBatchNormV3:0"
input: "model/conv_dw_3_relu/Relu6_min__51"
input: "model/conv_pw_4_relu/Relu6_max__74"
output: "model/conv_pw_7_relu/Relu6:0"
name: "model/conv_pw_7_relu/Relu6"
op_type: "Clip"
, input: "model/conv_pw_7_relu/Relu6:0"
input: "model/conv_dw_8/depthwise_weights_fused_bn"
input: "model/conv_dw_8/depthwise_bias_fused_bn"
output: "model/conv_dw_8_bn/FusedBatchNormV3:0"
name: "model/conv_dw_8/depthwise"
op_type: "Conv"
attribute {
  name: "dilations"
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "strides"
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "kernel_shape"
  ints: 3
  ints: 3
  type: INTS
}
attribute {
  name: "group"
  i: 512
  type: INT
}
attribute {
  name: "pads"
  ints: 1
  ints: 1
  ints: 1
  ints: 1
  type: INTS
}
, input: "model/conv_dw_8_bn/FusedBatchNormV3:0"
input: "model/conv_dw_3_relu/Relu6_min__51"
input: "model/conv_pw_4_relu/Relu6_max__74"
output: "model/conv_dw_8_relu/Relu6:0"
name: "model/conv_dw_8_relu/Relu6"
op_type: "Clip"
, input: "model/conv_dw_8_relu/Relu6:0"
input: "model/conv_pw_8/Conv2D_weights_fused_bn"
input: "model/conv_pw_8/Conv2D_bias_fused_bn"
output: "model/conv_pw_8_bn/FusedBatchNormV3:0"
name: "model/conv_pw_8/Conv2D"
op_type: "Conv"
attribute {
  name: "dilations"
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "strides"
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "kernel_shape"
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "pads"
  ints: 0
  ints: 0
  ints: 0
  ints: 0
  type: INTS
}
attribute {
  name: "group"
  i: 1
  type: INT
}
, input: "model/conv_pw_8_bn/FusedBatchNormV3:0"
input: "model/conv_dw_3_relu/Relu6_min__51"
input: "model/conv_pw_4_relu/Relu6_max__74"
output: "model/conv_pw_8_relu/Relu6:0"
name: "model/conv_pw_8_relu/Relu6"
op_type: "Clip"
, input: "model/conv_pw_8_relu/Relu6:0"
input: "model/conv_dw_9/depthwise_weights_fused_bn"
input: "model/conv_dw_9/depthwise_bias_fused_bn"
output: "model/conv_dw_9_bn/FusedBatchNormV3:0"
name: "model/conv_dw_9/depthwise"
op_type: "Conv"
attribute {
  name: "dilations"
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "strides"
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "kernel_shape"
  ints: 3
  ints: 3
  type: INTS
}
attribute {
  name: "group"
  i: 512
  type: INT
}
attribute {
  name: "pads"
  ints: 1
  ints: 1
  ints: 1
  ints: 1
  type: INTS
}
, input: "model/conv_dw_9_bn/FusedBatchNormV3:0"
input: "model/conv_dw_3_relu/Relu6_min__51"
input: "model/conv_pw_4_relu/Relu6_max__74"
output: "model/conv_dw_9_relu/Relu6:0"
name: "model/conv_dw_9_relu/Relu6"
op_type: "Clip"
, input: "model/conv_dw_9_relu/Relu6:0"
input: "model/conv_pw_9/Conv2D_weights_fused_bn"
input: "model/conv_pw_9/Conv2D_bias_fused_bn"
output: "model/conv_pw_9_bn/FusedBatchNormV3:0"
name: "model/conv_pw_9/Conv2D"
op_type: "Conv"
attribute {
  name: "dilations"
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "strides"
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "kernel_shape"
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "pads"
  ints: 0
  ints: 0
  ints: 0
  ints: 0
  type: INTS
}
attribute {
  name: "group"
  i: 1
  type: INT
}
, input: "model/conv_pw_9_bn/FusedBatchNormV3:0"
input: "model/conv_dw_3_relu/Relu6_min__51"
input: "model/conv_pw_4_relu/Relu6_max__74"
output: "model/conv_pw_9_relu/Relu6:0"
name: "model/conv_pw_9_relu/Relu6"
op_type: "Clip"
, input: "model/conv_pw_9_relu/Relu6:0"
input: "model/conv_dw_10/depthwise_weights_fused_bn"
input: "model/conv_dw_10/depthwise_bias_fused_bn"
output: "model/conv_dw_10_bn/FusedBatchNormV3:0"
name: "model/conv_dw_10/depthwise"
op_type: "Conv"
attribute {
  name: "dilations"
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "strides"
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "kernel_shape"
  ints: 3
  ints: 3
  type: INTS
}
attribute {
  name: "group"
  i: 512
  type: INT
}
attribute {
  name: "pads"
  ints: 1
  ints: 1
  ints: 1
  ints: 1
  type: INTS
}
, input: "model/conv_dw_10_bn/FusedBatchNormV3:0"
input: "model/conv_dw_3_relu/Relu6_min__51"
input: "model/conv_pw_4_relu/Relu6_max__74"
output: "model/conv_dw_10_relu/Relu6:0"
name: "model/conv_dw_10_relu/Relu6"
op_type: "Clip"
, input: "model/conv_dw_10_relu/Relu6:0"
input: "model/conv_pw_10/Conv2D_weights_fused_bn"
input: "model/conv_pw_10/Conv2D_bias_fused_bn"
output: "model/conv_pw_10_bn/FusedBatchNormV3:0"
name: "model/conv_pw_10/Conv2D"
op_type: "Conv"
attribute {
  name: "dilations"
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "strides"
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "kernel_shape"
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "pads"
  ints: 0
  ints: 0
  ints: 0
  ints: 0
  type: INTS
}
attribute {
  name: "group"
  i: 1
  type: INT
}
, input: "model/conv_pw_10_bn/FusedBatchNormV3:0"
input: "model/conv_dw_3_relu/Relu6_min__51"
input: "model/conv_pw_4_relu/Relu6_max__74"
output: "model/conv_pw_10_relu/Relu6:0"
name: "model/conv_pw_10_relu/Relu6"
op_type: "Clip"
, input: "model/conv_pw_10_relu/Relu6:0"
input: "model/conv_dw_11/depthwise_weights_fused_bn"
input: "model/conv_dw_11/depthwise_bias_fused_bn"
output: "model/conv_dw_11_bn/FusedBatchNormV3:0"
name: "model/conv_dw_11/depthwise"
op_type: "Conv"
attribute {
  name: "dilations"
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "strides"
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "kernel_shape"
  ints: 3
  ints: 3
  type: INTS
}
attribute {
  name: "group"
  i: 512
  type: INT
}
attribute {
  name: "pads"
  ints: 1
  ints: 1
  ints: 1
  ints: 1
  type: INTS
}
, input: "model/conv_dw_11_bn/FusedBatchNormV3:0"
input: "model/conv_dw_3_relu/Relu6_min__51"
input: "model/conv_pw_4_relu/Relu6_max__74"
output: "model/conv_dw_11_relu/Relu6:0"
name: "model/conv_dw_11_relu/Relu6"
op_type: "Clip"
, input: "model/conv_dw_11_relu/Relu6:0"
input: "model/conv_pw_11/Conv2D_weights_fused_bn"
input: "model/conv_pw_11/Conv2D_bias_fused_bn"
output: "model/conv_pw_11_bn/FusedBatchNormV3:0"
name: "model/conv_pw_11/Conv2D"
op_type: "Conv"
attribute {
  name: "dilations"
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "strides"
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "kernel_shape"
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "pads"
  ints: 0
  ints: 0
  ints: 0
  ints: 0
  type: INTS
}
attribute {
  name: "group"
  i: 1
  type: INT
}
, input: "model/conv_pw_11_bn/FusedBatchNormV3:0"
input: "model/conv_dw_3_relu/Relu6_min__51"
input: "model/conv_pw_4_relu/Relu6_max__74"
output: "model/conv_pw_11_relu/Relu6:0"
name: "model/conv_pw_11_relu/Relu6"
op_type: "Clip"
, input: "model/conv_pw_11_relu/Relu6:0"
input: "pad_const__28"
output: "model/conv_pad_12/Pad:0"
name: "model/conv_pad_12/Pad"
op_type: "Pad"
, input: "model/conv_pad_12/Pad:0"
input: "model/conv_dw_12/depthwise_weights_fused_bn"
input: "model/conv_dw_12/depthwise_bias_fused_bn"
output: "model/conv_dw_12_bn/FusedBatchNormV3:0"
name: "model/conv_dw_12/depthwise"
op_type: "Conv"
attribute {
  name: "dilations"
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "strides"
  ints: 2
  ints: 2
  type: INTS
}
attribute {
  name: "kernel_shape"
  ints: 3
  ints: 3
  type: INTS
}
attribute {
  name: "group"
  i: 512
  type: INT
}
, input: "model/conv_dw_12_bn/FusedBatchNormV3:0"
input: "model/conv_dw_3_relu/Relu6_min__51"
input: "model/conv_pw_4_relu/Relu6_max__74"
output: "model/conv_dw_12_relu/Relu6:0"
name: "model/conv_dw_12_relu/Relu6"
op_type: "Clip"
, input: "model/conv_dw_12_relu/Relu6:0"
input: "model/conv_pw_12/Conv2D_weights_fused_bn"
input: "model/conv_pw_12/Conv2D_bias_fused_bn"
output: "model/conv_pw_12_bn/FusedBatchNormV3:0"
name: "model/conv_pw_12/Conv2D"
op_type: "Conv"
attribute {
  name: "dilations"
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "strides"
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "kernel_shape"
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "pads"
  ints: 0
  ints: 0
  ints: 0
  ints: 0
  type: INTS
}
attribute {
  name: "group"
  i: 1
  type: INT
}
, input: "model/conv_pw_12_bn/FusedBatchNormV3:0"
input: "model/conv_dw_3_relu/Relu6_min__51"
input: "model/conv_pw_4_relu/Relu6_max__74"
output: "model/conv_pw_12_relu/Relu6:0"
name: "model/conv_pw_12_relu/Relu6"
op_type: "Clip"
, input: "model/conv_pw_12_relu/Relu6:0"
input: "model/conv_dw_13/depthwise_weights_fused_bn"
input: "model/conv_dw_13/depthwise_bias_fused_bn"
output: "model/conv_dw_13_bn/FusedBatchNormV3:0"
name: "model/conv_dw_13/depthwise"
op_type: "Conv"
attribute {
  name: "dilations"
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "strides"
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "kernel_shape"
  ints: 3
  ints: 3
  type: INTS
}
attribute {
  name: "group"
  i: 1024
  type: INT
}
attribute {
  name: "pads"
  ints: 1
  ints: 1
  ints: 1
  ints: 1
  type: INTS
}
, input: "model/conv_dw_13_bn/FusedBatchNormV3:0"
input: "model/conv_dw_3_relu/Relu6_min__51"
input: "model/conv_pw_4_relu/Relu6_max__74"
output: "model/conv_dw_13_relu/Relu6:0"
name: "model/conv_dw_13_relu/Relu6"
op_type: "Clip"
, input: "model/conv_dw_13_relu/Relu6:0"
input: "model/conv_pw_13/Conv2D_weights_fused_bn"
input: "model/conv_pw_13/Conv2D_bias_fused_bn"
output: "model/conv_pw_13_bn/FusedBatchNormV3:0"
name: "model/conv_pw_13/Conv2D"
op_type: "Conv"
attribute {
  name: "dilations"
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "strides"
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "kernel_shape"
  ints: 1
  ints: 1
  type: INTS
}
attribute {
  name: "pads"
  ints: 0
  ints: 0
  ints: 0
  ints: 0
  type: INTS
}
attribute {
  name: "group"
  i: 1
  type: INT
}
, input: "model/conv_pw_13_bn/FusedBatchNormV3:0"
input: "model/conv_dw_3_relu/Relu6_min__51"
input: "model/conv_pw_4_relu/Relu6_max__74"
output: "model/conv_pw_13_relu/Relu6:0"
name: "model/conv_pw_13_relu/Relu6"
op_type: "Clip"
, input: "model/conv_pw_13_relu/Relu6:0"
output: "model/global_average_pooling2d/Mean:0"
name: "model/global_average_pooling2d/Mean"
op_type: "GlobalAveragePool"
, input: "model/global_average_pooling2d/Mean:0"
output: "model/global_average_pooling2d/Mean_Squeeze__225:0"
name: "model/global_average_pooling2d/Mean_Squeeze__225"
op_type: "Squeeze"
attribute {
  name: "axes"
  ints: 2
  ints: 3
  type: INTS
}
domain: ""
, input: "model/global_average_pooling2d/Mean_Squeeze__225:0"
input: "model/dense/MatMul/ReadVariableOp:0"
input: "model/dense/BiasAdd/ReadVariableOp:0"
output: "model/dense/MatMul_Gemm__6:0"
name: "model/dense/MatMul_Gemm__6"
op_type: "Gemm"
attribute {
  name: "transA"
  i: 0
  type: INT
}
attribute {
  name: "transB"
  i: 0
  type: INT
}
domain: ""
, input: "model/dense/MatMul_Gemm__6:0"
output: "dense"
name: "model/dense/Softmax"
op_type: "Softmax"
attribute {
  name: "axis"
  i: 1
  type: INT
}
]
 
Can you please help me to solve this?
Thanks,
  • Up0
  • Down0
c_zhanpe
Join Date: 12 Apr 20
Posts: 4
Posted: Thu, 2022-02-10 23:22

can you provide your onnx model ?

  • Up0
  • Down0
c_zhanpe
Join Date: 12 Apr 20
Posts: 4
Posted: Thu, 2022-02-10 23:41

Hi,

i notice snpe enforces transB=1,weights have to be transposebut your model protoc message show transB=0,maybe that's rootcause.

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.