Skip to content

Commit 93094bd

Browse files
authored
Fix onnxrt calibration zero-size array error (#1296)
1 parent d98c83a commit 93094bd

File tree

13 files changed

+63
-72
lines changed

13 files changed

+63
-72
lines changed

examples/onnxrt/image_recognition/mobilenet_v2/quantization/ptq/mobilenet_v2.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ quantization: # optional. tuning constrai
3333
width: 224
3434
mean_value: [0.485, 0.456, 0.406]
3535
op_wise: {
36-
'Gather_*': {
36+
'Gather_.*?': {
3737
'activation': {'dtype': ['fp32']},
3838
'weight': {'dtype': ['fp32']}
3939
},

examples/onnxrt/image_recognition/mobilenet_v2/quantization/ptq/mobilenet_v2_qdq.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ quantization: # optional. tuning constrai
3333
width: 224
3434
mean_value: [0.485, 0.456, 0.406]
3535
op_wise: {
36-
'Gather_*': {
36+
'Gather_.*?': {
3737
'activation': {'dtype': ['fp32']},
3838
'weight': {'dtype': ['fp32']}
3939
},

examples/onnxrt/object_detection/onnx_model_zoo/ssd_mobilenet_v1/quantization/ptq/ssd_mobilenet_v1.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ model: # mandatory. used to specif
2424
quantization: # optional. tuning constraints on model-wise for advance user to reduce tuning space.
2525
approach: post_training_static_quant
2626
op_wise: {
27-
'Preprocessor/*': {'weight': {'dtype': ['fp32']}, 'activation': {'dtype': ['fp32']}},
27+
'Preprocessor/.*?': {'weight': {'dtype': ['fp32']}, 'activation': {'dtype': ['fp32']}},
2828
'add': {'weight': {'dtype': ['fp32']}, 'activation': {'dtype': ['fp32']}},
29-
'Postprocessor/*': {'weight': {'dtype': ['fp32']}, 'activation': {'dtype': ['fp32']}},
29+
'Postprocessor/.*?': {'weight': {'dtype': ['fp32']}, 'activation': {'dtype': ['fp32']}},
3030

3131
}
3232
calibration:

examples/onnxrt/object_detection/onnx_model_zoo/ssd_mobilenet_v1/quantization/ptq/ssd_mobilenet_v1_qdq.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ model: # mandatory. used to specif
2424
quantization: # optional. tuning constraints on model-wise for advance user to reduce tuning space.
2525
approach: post_training_static_quant
2626
op_wise: {
27-
'Preprocessor/*': {'weight': {'dtype': ['fp32']}, 'activation': {'dtype': ['fp32']}},
27+
'Preprocessor/.*?': {'weight': {'dtype': ['fp32']}, 'activation': {'dtype': ['fp32']}},
2828
'add': {'weight': {'dtype': ['fp32']}, 'activation': {'dtype': ['fp32']}},
29-
'Postprocessor/*': {'weight': {'dtype': ['fp32']}, 'activation': {'dtype': ['fp32']}},
29+
'Postprocessor/.*?': {'weight': {'dtype': ['fp32']}, 'activation': {'dtype': ['fp32']}},
3030

3131
}
3232
calibration:

examples/onnxrt/object_detection/onnx_model_zoo/tiny_yolov3/quantization/ptq/tiny_yolov3.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ model: # mandatory. used to specif
2424
quantization: # optional. tuning constraints on model-wise for advance user to reduce tuning space.
2525
approach: post_training_static_quant
2626
op_wise: {
27-
'TFNodes/yolo_evaluation*?': {'activation': {'dtype': ['fp32']}, 'weight': {'dtype': ['fp32']}},
27+
'TFNodes/yolo_evaluation.*?': {'activation': {'dtype': ['fp32']}, 'weight': {'dtype': ['fp32']}},
2828
'conv2d_10': {'activation': {'dtype': ['fp32']}, 'weight': {'dtype': ['fp32']}},
2929
'conv2d_13': {'activation': {'dtype': ['fp32']}, 'weight': {'dtype': ['fp32']}},
3030
}

examples/onnxrt/object_detection/onnx_model_zoo/yolov3/quantization/ptq/yolov3.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ model: # mandatory. used to specif
2424
quantization: # optional. tuning constraints on model-wise for advance user to reduce tuning space.
2525
approach: post_training_static_quant
2626
op_wise: {
27-
'TFNodes/yolo_evaluation*': {'activation': {'dtype': ['fp32']}, 'weight': {'dtype': ['fp32']}},
27+
'TFNodes/yolo_evaluation.*?': {'activation': {'dtype': ['fp32']}, 'weight': {'dtype': ['fp32']}},
2828
'conv2d_1': {'activation': {'dtype': ['fp32']}, 'weight': {'dtype': ['fp32']}},
2929
'leaky_re_lu_1': {'activation': {'dtype': ['fp32']}, 'weight': {'dtype': ['fp32']}},
3030
'conv2d_59': {'activation': {'dtype': ['fp32']}, 'weight': {'dtype': ['fp32']}},

examples/onnxrt/object_detection/onnx_model_zoo/yolov4/quantization/ptq/yolov4.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ model: # mandatory. used to specif
2424
quantization: # optional. tuning constraints on model-wise for advance user to reduce tuning space.
2525
approach: post_training_static_quant
2626
op_wise: {
27-
'StatefulPartitionedCall/model/lambda*?': {'activation': {'dtype': ['fp32']}, 'weight': {'dtype': ['fp32']}},
28-
'StatefulPartitionedCall/model/tf_op_layer_add*?': {'activation': {'dtype': ['fp32']}, 'weight': {'dtype': ['fp32']}},
29-
'StatefulPartitionedCall/model/tf_op_layer_Sigmoid*?': {'activation': {'dtype': ['fp32']}, 'weight': {'dtype': ['fp32']}},
30-
'StatefulPartitionedCall/model/tf_op_layer_split*?': {'activation': {'dtype': ['fp32']}, 'weight': {'dtype': ['fp32']}},
31-
'StatefulPartitionedCall/model/tf_op_layer_Reshape*?': {'activation': {'dtype': ['fp32']}, 'weight': {'dtype': ['fp32']}},
32-
'Transpose*?': {'activation': {'dtype': ['fp32']}, 'weight': {'dtype': ['fp32']}},
27+
'StatefulPartitionedCall/model/lambda.*?': {'activation': {'dtype': ['fp32']}, 'weight': {'dtype': ['fp32']}},
28+
'StatefulPartitionedCall/model/tf_op_layer_add.*?': {'activation': {'dtype': ['fp32']}, 'weight': {'dtype': ['fp32']}},
29+
'StatefulPartitionedCall/model/tf_op_layer_Sigmoid.*?': {'activation': {'dtype': ['fp32']}, 'weight': {'dtype': ['fp32']}},
30+
'StatefulPartitionedCall/model/tf_op_layer_split.*?': {'activation': {'dtype': ['fp32']}, 'weight': {'dtype': ['fp32']}},
31+
'StatefulPartitionedCall/model/tf_op_layer_Reshape.*?': {'activation': {'dtype': ['fp32']}, 'weight': {'dtype': ['fp32']}},
32+
'Transpose.*?': {'activation': {'dtype': ['fp32']}, 'weight': {'dtype': ['fp32']}},
3333
'StatefulPartitionedCall/model/conv2d_101/BiasAdd': {'activation': {'dtype': ['fp32']}, 'weight': {'dtype': ['fp32']}},
3434
'StatefulPartitionedCall/model/conv2d_109/BiasAdd': {'activation': {'dtype': ['fp32']}, 'weight': {'dtype': ['fp32']}},
3535
}

examples/onnxrt/object_detection/ssd_mobilenet_v1/quantization/ptq/ssd_mobilenet_v1.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ quantization: # optional. tuning constrai
5757
'activation': {'dtype': ['fp32']},
5858
'weight': {'dtype': ['fp32']}
5959
},
60-
'Gather__*': {
60+
'Gather__.*?': {
6161
'activation': {'dtype': ['fp32']},
6262
'weight': {'dtype': ['fp32']}
6363
},

examples/onnxrt/object_detection/ssd_mobilenet_v1/quantization/ptq/ssd_mobilenet_v1_qdq.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ quantization: # optional. tuning constrai
5757
'activation': {'dtype': ['fp32']},
5858
'weight': {'dtype': ['fp32']}
5959
},
60-
'Gather__*': {
60+
'Gather__.*?': {
6161
'activation': {'dtype': ['fp32']},
6262
'weight': {'dtype': ['fp32']}
6363
},

examples/onnxrt/object_detection/ssd_mobilenet_v2/quantization/ptq/ssd_mobilenet_v2.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ quantization: # optional. tuning constrai
6161
'activation': {'dtype': ['fp32']},
6262
'weight': {'dtype': ['fp32']}
6363
},
64-
'Gather__*': {
64+
'Gather__.*?': {
6565
'activation': {'dtype': ['fp32']},
6666
'weight': {'dtype': ['fp32']}
6767
},

0 commit comments

Comments
 (0)