Skip to content

Commit d1993a7

Browse files
authored
Add opset 16 support and check ci (#1937)
* add opset 16 support and ci * python 3.7 requires tf>=1.13 Signed-off-by: Deyu Huang <deyhuang@microsoft.com>
1 parent cc16eb9 commit d1993a7

File tree

5 files changed

+16
-7
lines changed

5 files changed

+16
-7
lines changed

ci_build/azure_pipelines/templates/job_generator.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ parameters:
55
python_versions: ['3.7']
66
tf_versions: ['']
77
onnx_versions: ['']
8-
onnx_opsets: ['15', '14', '13', '12', '11', '10', '9']
9-
onnx_backends: {onnxruntime: ['1.10.0']}
8+
onnx_opsets: ['16', '15', '14', '13', '12', '11', '10', '9']
9+
onnx_backends: {onnxruntime: ['1.11.0']}
1010
job: {}
1111
run_setup: 'True'
1212
report_coverage: 'False'

ci_build/azure_pipelines/templates/setup.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,22 @@ steps:
44
- bash: |
55
set -ex
66
pip install pytest pytest-cov pytest-runner coverage graphviz requests pyyaml pillow pandas parameterized
7-
pip install $(CI_PIP_TF_NAME) $(CI_PIP_ONNX_NAME) $(CI_PIP_ONNX_BACKEND_NAME)
7+
pip install $(CI_PIP_TF_NAME) $(CI_PIP_ONNX_NAME)
88
9+
# TF < 2.7 reuires numpy <= 1.19, but onnxruntime >= 1.11 requires numpy >= 1.21
10+
if [[ $CI_TF_VERSION < 2.7 ]] && [[ $CI_ONNX_BACKEND == "onnxruntime" ]] ;
11+
then
12+
pip install $(CI_PIP_ONNX_BACKEND_NAME) numpy --no-deps -U
13+
else
14+
pip install $(CI_PIP_ONNX_BACKEND_NAME)
15+
fi
916
# TF 1.10 requires numpy <=1.14.5 and >=1.13.3, but onnxruntime 0.2.1 does not work with numpy <= 1.14.5
1017
# Upgrade numpy only within constraints from other packages if any.
1118
if [[ $CI_TF_VERSION == 1.10* ]] && [[ $CI_ONNX_BACKEND == "onnxruntime" ]] ;
1219
then
1320
pip install $(CI_PIP_ONNX_NAME) $(CI_PIP_ONNX_BACKEND_NAME) numpy --no-deps -U
1421
fi
22+
1523
if [[ $CI_ONNXRUNTIME_NIGHTLY == "true" ]] ;
1624
then
1725
pip uninstall -y onnxruntime

ci_build/azure_pipelines/templates/unit_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Run unit test
22

33
parameters:
4-
onnx_opsets: ['15', '14', '13', '12', '11', '10', '9', '8']
4+
onnx_opsets: ['16', '15', '14', '13', '12', '11', '10', '9']
55
skip_tflite_tests: 'True'
66
skip_tfjs_tests: 'True'
77
skip_tf_tests: 'False'

tests/run_pretrained_models.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ ssd_mobilenet_v3_large_coco:
337337
opset_constraints:
338338
"onnx":
339339
"min": 10
340-
"max": 15
340+
"max": 16
341341
input_get: get_beach
342342
inputs:
343343
"normalized_input_image_tensor:0": [1, 320, 320, 3]
@@ -432,7 +432,7 @@ faster_rcnn_inception_v2_coco:
432432
opset_constraints:
433433
"onnx":
434434
"min": 11
435-
"max": 15
435+
"max": 16
436436
input_get: get_beach
437437
inputs:
438438
"image_tensor:0": [1, 224, 224, 3]

tf2onnx/constants.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050

5151
# Mapping opset to IR version.
5252
# Note: opset 7 and opset 8 came out with IR3 but we need IR4 because of PlaceholderWithDefault
53+
# Refer from https://github.com/onnx/onnx/blob/main/docs/Versioning.md#released-versions
5354
OPSET_TO_IR_VERSION = {
54-
1: 3, 2: 3, 3: 3, 4: 3, 5: 3, 6: 3, 7: 4, 8: 4, 9: 4, 10: 5, 11: 6, 12: 7, 13: 7, 14: 7, 15: 8
55+
1: 3, 2: 3, 3: 3, 4: 3, 5: 3, 6: 3, 7: 4, 8: 4, 9: 4, 10: 5, 11: 6, 12: 7, 13: 7, 14: 7, 15: 8, 16: 8
5556
}

0 commit comments

Comments
 (0)