Skip to content

Commit e177a26

Browse files
authored
Enable support to ONNX 1.15. (#2279)
* Add attr_type for empty sequence attribute. * Process attributes to avoid empty iterator error. * Do not use strict mode while checking node shape. * Update CI to work with ONNX 1.15.0. Signed-off-by: Jay Zhang <[email protected]> --------- Signed-off-by: Jay Zhang <[email protected]> Signed-off-by: Jay Zhang <[email protected]>
1 parent 85a10b5 commit e177a26

17 files changed

+130
-48
lines changed

ci_build/azure_pipelines/keras2onnx_application_tests.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
matrix:
1111
Python37-tf-1.15:
1212
python.version: '3.7' # Max version that supports tf 1.15
13-
ONNX_PATH: onnx==1.14.1
13+
ONNX_PATH: onnx==1.14.1 # Max version that supports python 3.7
1414
INSTALL_KERAS: pip install keras==2.3.1
1515
UNINSTALL_KERAS:
1616
INSTALL_TENSORFLOW: pip install tensorflow==1.15.0
@@ -23,7 +23,7 @@ jobs:
2323

2424
Python39-tf2-2.12:
2525
python.version: '3.9'
26-
ONNX_PATH: onnx==1.14.1
26+
ONNX_PATH: onnx==1.15.0
2727
INSTALL_KERAS:
2828
UNINSTALL_KERAS:
2929
INSTALL_TENSORFLOW: pip install tensorflow==2.12.0
@@ -35,7 +35,7 @@ jobs:
3535

3636
Python310-tf2-2.11:
3737
python.version: '3.10'
38-
ONNX_PATH: onnx==1.14.1
38+
ONNX_PATH: onnx==1.15.0
3939
INSTALL_KERAS:
4040
UNINSTALL_KERAS:
4141
INSTALL_TENSORFLOW: pip install tensorflow==2.11.0
@@ -47,7 +47,7 @@ jobs:
4747

4848
Python38-tf2-2.10:
4949
python.version: '3.8'
50-
ONNX_PATH: onnx==1.14.1
50+
ONNX_PATH: onnx==1.15.0
5151
INSTALL_KERAS:
5252
UNINSTALL_KERAS:
5353
INSTALL_TENSORFLOW: pip install tensorflow==2.10.0
@@ -59,7 +59,7 @@ jobs:
5959

6060
Python310-tf2-oldest:
6161
python.version: '3.10'
62-
ONNX_PATH: onnx==1.14.1
62+
ONNX_PATH: onnx==1.15.0
6363
INSTALL_KERAS:
6464
UNINSTALL_KERAS:
6565
INSTALL_TENSORFLOW: pip install tensorflow==2.8.0
@@ -82,7 +82,7 @@ jobs:
8282
matrix:
8383
Python37-tf-1.15:
8484
python.version: '3.7' # Max version that supports tf 1.15
85-
ONNX_PATH: onnx==1.14.1
85+
ONNX_PATH: onnx==1.14.1 # Max version that supports python 3.7
8686
INSTALL_KERAS: pip install keras==2.3.1
8787
UNINSTALL_KERAS:
8888
INSTALL_TENSORFLOW: pip install tensorflow==1.15.0
@@ -95,7 +95,7 @@ jobs:
9595

9696
Python39-tf2-2.12:
9797
python.version: '3.9'
98-
ONNX_PATH: onnx==1.14.1
98+
ONNX_PATH: onnx==1.15.0
9999
INSTALL_KERAS:
100100
UNINSTALL_KERAS:
101101
INSTALL_TENSORFLOW: pip install tensorflow==2.12.0
@@ -107,7 +107,7 @@ jobs:
107107

108108
Python310-tf2-2.11:
109109
python.version: '3.10'
110-
ONNX_PATH: onnx==1.14.1
110+
ONNX_PATH: onnx==1.15.0
111111
INSTALL_KERAS:
112112
UNINSTALL_KERAS:
113113
INSTALL_TENSORFLOW: pip install tensorflow==2.11.0
@@ -119,7 +119,7 @@ jobs:
119119

120120
Python38-tf2-2.10:
121121
python.version: '3.8'
122-
ONNX_PATH: onnx==1.14.1
122+
ONNX_PATH: onnx==1.15.0
123123
INSTALL_KERAS:
124124
UNINSTALL_KERAS:
125125
INSTALL_TENSORFLOW: pip install tensorflow==2.10.0
@@ -131,7 +131,7 @@ jobs:
131131

132132
Python310-tf2-oldest:
133133
python.version: '3.10'
134-
ONNX_PATH: onnx==1.14.1
134+
ONNX_PATH: onnx==1.15.0
135135
INSTALL_KERAS:
136136
UNINSTALL_KERAS:
137137
INSTALL_TENSORFLOW: pip install tensorflow==2.8.0

ci_build/azure_pipelines/keras2onnx_unit_test.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,50 +10,50 @@ jobs:
1010
############ TF Keras Unit Tests ############
1111
Python310-tf2-2.13:
1212
python.version: '3.10'
13-
ONNX_PATH: onnx==1.14.1
13+
ONNX_PATH: onnx==1.15.0
1414
TENSORFLOW_PATH: tensorflow==2.13.0
1515
INSTALL_ORT: pip install onnxruntime==1.15.0
1616
INSTALL_NUMPY:
1717

1818
Python38-tf2-2.12:
1919
python.version: '3.8'
20-
ONNX_PATH: onnx==1.14.1
20+
ONNX_PATH: onnx==1.15.0
2121
TENSORFLOW_PATH: tensorflow==2.12.0
2222
INSTALL_ORT: pip install onnxruntime==1.15.0
2323
INSTALL_NUMPY:
2424

2525
Python39-tf2-2.11:
2626
python.version: '3.9'
27-
ONNX_PATH: onnx==1.14.1
27+
ONNX_PATH: onnx==1.15.0
2828
TENSORFLOW_PATH: tensorflow==2.11.0
2929
INSTALL_ORT: pip install onnxruntime==1.15.0
3030
INSTALL_NUMPY:
3131

3232
Python310-tf2-2.10:
3333
python.version: '3.10'
34-
ONNX_PATH: onnx==1.14.1
34+
ONNX_PATH: onnx==1.15.0
3535
TENSORFLOW_PATH: tensorflow==2.10.0
3636
INSTALL_ORT: pip install onnxruntime==1.15.0
3737
INSTALL_NUMPY:
3838

3939
Python38-tf2-2.9:
4040
python.version: '3.8'
41-
ONNX_PATH: onnx==1.14.1
41+
ONNX_PATH: onnx==1.15.0
4242
TENSORFLOW_PATH: tensorflow==2.9.0
4343
INSTALL_ORT: pip install onnxruntime==1.15.0
4444
INSTALL_NUMPY:
4545

4646
Python310-tf2-oldest:
4747
python.version: '3.10'
48-
ONNX_PATH: onnx==1.14.1
48+
ONNX_PATH: onnx==1.15.0
4949
TENSORFLOW_PATH: tensorflow==2.8.0
5050
INSTALL_ORT: pip install onnxruntime==1.15.0
5151
INSTALL_NUMPY:
5252

5353
############ Pure Keras Unit Tests ############
5454
Keras-Py37-tf1.15.0:
5555
python.version: '3.7' # Max version that supports tf 1.15
56-
ONNX_PATH: onnx==1.14.1
56+
ONNX_PATH: onnx==1.14.1 # Max version that supports python 3.7
5757
KERAS: keras==2.4.3
5858
TENSORFLOW_PATH: tensorflow==1.15.0
5959
INSTALL_ORT: pip install onnxruntime==1.14.1 # Max version that supports python 3.7
@@ -72,50 +72,50 @@ jobs:
7272
############ TF Keras Unit Tests ############
7373
Python310-tf2-2.13:
7474
python.version: '3.10'
75-
ONNX_PATH: onnx==1.14.1
75+
ONNX_PATH: onnx==1.15.0
7676
TENSORFLOW_PATH: tensorflow==2.13.0
7777
INSTALL_ORT: pip install onnxruntime==1.15.0
7878
INSTALL_NUMPY:
7979

8080
Python38-tf2-2.12:
8181
python.version: '3.8'
82-
ONNX_PATH: onnx==1.14.1
82+
ONNX_PATH: onnx==1.15.0
8383
TENSORFLOW_PATH: tensorflow==2.12.0
8484
INSTALL_ORT: pip install onnxruntime==1.15.0
8585
INSTALL_NUMPY:
8686

8787
Python39-tf2-2.11:
8888
python.version: '3.9'
89-
ONNX_PATH: onnx==1.14.1
89+
ONNX_PATH: onnx==1.15.0
9090
TENSORFLOW_PATH: tensorflow==2.11.0
9191
INSTALL_ORT: pip install onnxruntime==1.15.0
9292
INSTALL_NUMPY:
9393

9494
Python310-tf2-2.10:
9595
python.version: '3.10'
96-
ONNX_PATH: onnx==1.14.1
96+
ONNX_PATH: onnx==1.15.0
9797
TENSORFLOW_PATH: tensorflow==2.10.0
9898
INSTALL_ORT: pip install onnxruntime==1.15.0
9999
INSTALL_NUMPY:
100100

101101
Python38-tf2-2.9:
102102
python.version: '3.8'
103-
ONNX_PATH: onnx==1.14.1
103+
ONNX_PATH: onnx==1.15.0
104104
TENSORFLOW_PATH: tensorflow==2.9.0
105105
INSTALL_ORT: pip install onnxruntime==1.15.0
106106
INSTALL_NUMPY:
107107

108108
Python310-tf2-oldest:
109109
python.version: '3.10'
110-
ONNX_PATH: onnx==1.14.1
110+
ONNX_PATH: onnx==1.15.0
111111
TENSORFLOW_PATH: tensorflow==2.8.0
112112
INSTALL_ORT: pip install onnxruntime==1.15.0
113113
INSTALL_NUMPY:
114114

115115
############ Pure Keras Unit Tests ############
116116
Keras-Py37-tf1.15.0:
117117
python.version: '3.7' # Max version that supports tf 1.15
118-
ONNX_PATH: onnx==1.14.1
118+
ONNX_PATH: onnx==1.14.1 # Max version that supports python 3.7
119119
KERAS: keras==2.4.3
120120
TENSORFLOW_PATH: tensorflow==1.15.0
121121
INSTALL_ORT: pip install onnxruntime==1.14.1 # Max version that supports python 3.7

ci_build/azure_pipelines/onnxruntime_nightly_test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ stages:
88
platforms: ['linux', 'windows']
99
python_versions: [3.7']
1010
tf_versions: ['1.15.5']
11+
onnx_versions: ['1.14.1'] # Max version that supports python 3.7
1112
onnx_backends: {onnxruntime: ['nightly']}
1213
job:
1314
steps:

ci_build/azure_pipelines/pretrained_model_test-matrix.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ jobs:
77
platforms: ['windows']
88
python_versions: ['3.7'] # Max version that supports tf 1.15
99
tf_versions: ['1.15.5']
10+
onnx_versions: ['1.14.1'] # Max version that supports python 3.7
1011
onnx_opsets: ['18', '17', '16', '15']
1112
onnx_backends: {onnxruntime: ['1.14.1']} # Max version that supports python 3.7
1213
job:
@@ -28,6 +29,7 @@ jobs:
2829
platforms: ['linux', 'windows']
2930
python_versions: ['3.7'] # Max version that supports tf 1.15
3031
tf_versions: ['1.15.5']
32+
onnx_versions: ['1.14.1'] # Max version that supports python 3.7
3133
onnx_opsets: ['14']
3234
onnx_backends: {onnxruntime: ['1.14.1']} # Max version that supports python 3.7
3335
job:

ci_build/azure_pipelines/pretrained_model_test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ jobs:
66
platforms: ['linux']
77
python_versions: ['3.7'] # Max version that supports tf 1.15
88
tf_versions: ['1.15.5']
9+
onnx_versions: ['1.14.1'] # Max version that supports python 3.7
910
onnx_opsets: ['18', '17', '16', '15']
1011
onnx_backends: {onnxruntime: ['1.14.1']} # Max version that supports python 3.7
1112
job:

ci_build/azure_pipelines/templates/job_generator.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ parameters:
44
platforms: ['linux']
55
python_versions: ['3.8']
66
tf_versions: ['']
7-
onnx_versions: ['1.14.1']
7+
onnx_versions: ['1.15.0']
88
onnx_opsets: ['18', '17', '16', '15', '14']
99
onnx_backends: {onnxruntime: ['1.15.1']}
1010
job: {}

ci_build/azure_pipelines/trimmed_keras2onnx_application_tests.yml

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
matrix:
1111
Python37-tf-1.15:
1212
python.version: '3.7' # Max version that supports tf 1.15
13-
ONNX_PATH: onnx==1.14.1
13+
ONNX_PATH: onnx==1.14.1 # Max version that supports python 3.7
1414
INSTALL_KERAS: pip install keras==2.3.1
1515
UNINSTALL_KERAS:
1616
INSTALL_TENSORFLOW: pip install tensorflow==1.15.0
@@ -23,7 +23,7 @@ jobs:
2323

2424
Python38-tf2-oldest:
2525
python.version: '3.8'
26-
ONNX_PATH: onnx==1.14.1
26+
ONNX_PATH: onnx==1.15.0
2727
INSTALL_KERAS:
2828
UNINSTALL_KERAS:
2929
INSTALL_TENSORFLOW: pip install tensorflow==2.8.0
@@ -35,7 +35,31 @@ jobs:
3535

3636
Python38-tf2-2.13:
3737
python.version: '3.8'
38-
ONNX_PATH: onnx==1.14.1
38+
ONNX_PATH: onnx==1.15.0
39+
INSTALL_KERAS:
40+
UNINSTALL_KERAS:
41+
INSTALL_TENSORFLOW: pip install tensorflow==2.13.0
42+
INSTALL_ORT: pip install onnxruntime==1.15.0
43+
INSTALL_KERAS_RESNET: pip install keras-resnet
44+
INSTALL_TRANSFORMERS: pip install transformers==4.2.0
45+
INSTALL_NUMPY:
46+
NIGHTLY_BUILD_TEST: python run_all_v2.py
47+
48+
Python38-tf2-oldest-onnx-15:
49+
python.version: '3.8'
50+
ONNX_PATH: onnx==1.15.0
51+
INSTALL_KERAS:
52+
UNINSTALL_KERAS:
53+
INSTALL_TENSORFLOW: pip install tensorflow==2.8.0
54+
INSTALL_ORT: pip install onnxruntime==1.15.0
55+
INSTALL_KERAS_RESNET: pip install keras-resnet
56+
INSTALL_TRANSFORMERS: pip install transformers==4.2.0
57+
INSTALL_NUMPY:
58+
NIGHTLY_BUILD_TEST: python run_all_v2.py
59+
60+
Python38-tf2-2.13-onnx-15:
61+
python.version: '3.8'
62+
ONNX_PATH: onnx==1.15.0
3963
INSTALL_KERAS:
4064
UNINSTALL_KERAS:
4165
INSTALL_TENSORFLOW: pip install tensorflow==2.13.0

ci_build/azure_pipelines/trimmed_keras2onnx_unit_test.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,34 +11,35 @@ jobs:
1111
############ TF Keras Unit Tests ############
1212
Python37-tf-1.15:
1313
python.version: '3.7' # Max version that supports tf 1.15
14-
ONNX_PATH: onnx==1.14.1
14+
ONNX_PATH: onnx==1.14.1 # Max version that supports python 3.7
1515
TENSORFLOW_PATH: tensorflow==1.15.0
1616
INSTALL_ORT: pip install onnxruntime==1.14.1 # Max version that supports python 3.7
1717
INSTALL_NUMPY: pip install numpy==1.19.0
1818

1919
Python38-tf2-oldest:
2020
python.version: '3.8'
21-
ONNX_PATH: onnx==1.14.1
21+
ONNX_PATH: onnx==1.15.0
2222
TENSORFLOW_PATH: tensorflow==2.8.0
2323
INSTALL_ORT: pip install onnxruntime==1.15.0
2424
INSTALL_NUMPY:
2525

2626
Python38-tf2-2.13:
2727
python.version: '3.8'
28-
ONNX_PATH: onnx==1.14.1
28+
ONNX_PATH: onnx==1.15.0
2929
TENSORFLOW_PATH: tensorflow==2.13.0
3030
INSTALL_ORT: pip install onnxruntime==1.15.0
3131
INSTALL_NUMPY:
3232

3333
############ Pure Keras Unit Tests ############
3434
Keras-Py37-tf-1.15:
3535
python.version: '3.7' # Max version that supports tf 1.15
36-
ONNX_PATH: onnx==1.14.1
36+
ONNX_PATH: onnx==1.14.1 # Max version that supports python 3.7
3737
KERAS: keras==2.4.3
3838
TENSORFLOW_PATH: tensorflow==1.15.0
3939
INSTALL_ORT: pip install onnxruntime==1.14.1 # Max version that supports python 3.7
4040
INSTALL_NUMPY: pip install numpy==1.19.0
4141

42+
4243
steps:
4344
- template: 'templates/keras2onnx_unit_test.yml'
4445
parameters:
@@ -52,34 +53,35 @@ jobs:
5253
############ TF Keras Unit Tests ############
5354
Python37-tf-1.15:
5455
python.version: '3.7' # Max version that supports tf 1.15
55-
ONNX_PATH: onnx==1.14.1
56+
ONNX_PATH: onnx==1.14.1 # Max version that supports python 3.7
5657
TENSORFLOW_PATH: tensorflow==1.15.0
5758
INSTALL_ORT: pip install onnxruntime==1.14.1 # Max version that supports python 3.7
5859
INSTALL_NUMPY: pip install numpy==1.19.0
5960

6061
Python38-tf2-oldest:
6162
python.version: '3.8'
62-
ONNX_PATH: onnx==1.14.1
63+
ONNX_PATH: onnx==1.15.0
6364
TENSORFLOW_PATH: tensorflow==2.8.0
6465
INSTALL_ORT: pip install onnxruntime==1.15.0
6566
INSTALL_NUMPY:
6667

6768
Python38-tf2-2.13:
6869
python.version: '3.8'
69-
ONNX_PATH: onnx==1.14.1
70+
ONNX_PATH: onnx==1.15.0
7071
TENSORFLOW_PATH: tensorflow==2.13.0
7172
INSTALL_ORT: pip install onnxruntime==1.15.0
7273
INSTALL_NUMPY:
7374

7475
############ Pure Keras Unit Tests ############
7576
Keras-Py37-tf-1.15:
7677
python.version: '3.7' # Max version that supports tf 1.15
77-
ONNX_PATH: onnx==1.14.1
78+
ONNX_PATH: onnx==1.14.1 # Max version that supports python 3.7
7879
KERAS: keras==2.4.3
7980
TENSORFLOW_PATH: tensorflow==1.15.0
8081
INSTALL_ORT: pip install onnxruntime==1.14.1 # Max version that supports python 3.7
8182
INSTALL_NUMPY: pip install numpy==1.19.0
8283

84+
8385
steps:
8486
- template: 'templates/keras2onnx_unit_test.yml'
8587
parameters:

ci_build/azure_pipelines/unit_test-matrix.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ stages:
2222
python_versions: ['3.7'] # Max version that supports tf 1.15
2323
platforms: ['windows']
2424
tf_versions: ['1.15.5']
25+
onnx_versions: ['1.14.1'] # Max version that supports python 3.7
2526
onnx_opsets: ['18', '17', '16', '15']
2627
onnx_backends: {onnxruntime: ['1.14.1']} # Max version that supports python 3.7
2728
job:

ci_build/azure_pipelines/unit_test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ stages:
2222
python_versions: ['3.7'] # Max version that supports tf 1.15
2323
platforms: ['linux']
2424
tf_versions: ['1.15.5']
25+
onnx_versions: ['1.14.1'] # Max version that supports python 3.7
2526
onnx_opsets: ['18', '17', '16', '15']
2627
onnx_backends: {onnxruntime: ['1.14.1']} # Max version that supports python 3.7
2728
job:

0 commit comments

Comments
 (0)