Skip to content
This repository was archived by the owner on Oct 13, 2021. It is now read-only.

Commit f044d7c

Browse files
authored
Upgrade to opset 14 (#723)
1 parent 383e431 commit f044d7c

10 files changed

+21
-19
lines changed

.azure-pipelines/linux-CI-keras-applications-nightly.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838

3939
Python37:
4040
python.version: '3.7.3'
41-
ONNX_PATH: onnx==1.8.0
41+
ONNX_PATH: onnx==1.9.0
4242
INSTALL_KERAS: pip install keras==2.3.1
4343
UNINSTALL_KERAS:
4444
INSTALL_TENSORFLOW: pip install tensorflow==1.15.0
@@ -60,7 +60,7 @@ jobs:
6060

6161
Python38-tf2:
6262
python.version: '3.8'
63-
ONNX_PATH: onnx==1.8.0
63+
ONNX_PATH: onnx==1.9.0
6464
INSTALL_KERAS:
6565
UNINSTALL_KERAS: pip uninstall keras -y
6666
INSTALL_TENSORFLOW: pip install tensorflow==2.2.0

.azure-pipelines/linux-conda-CI-tf-keras.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ jobs:
3636
python.version: '3.8'
3737
ONNX_PATH: onnx==1.7.0
3838
TENSORFLOW_PATH: tensorflow-cpu==2.2.0
39-
INSTALL_ORT:
39+
INSTALL_ORT: pip install onnxruntime==1.6.0
4040

4141
Python38-tf2.3:
4242
python.version: '3.8'
43-
ONNX_PATH: onnx==1.8.0
43+
ONNX_PATH: onnx==1.9.0
4444
TENSORFLOW_PATH: tensorflow-cpu==2.3.0
45-
INSTALL_ORT: pip install onnxruntime==1.7.0
45+
INSTALL_ORT: pip install onnxruntime==1.8.0
4646

4747
maxParallel: 3
4848

.azure-pipelines/linux-conda-CI.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ jobs:
2929

3030
Python37-tf1150:
3131
python.version: '3.7'
32-
ONNX_PATH: onnx==1.8.0
32+
ONNX_PATH: onnx==1.9.0
3333
KERAS: keras==2.4.3
3434
TENSORFLOW_PATH: tensorflow==1.15.0
35-
INSTALL_ORT: pip install onnxruntime==1.6.0
35+
INSTALL_ORT: pip install onnxruntime==1.8.0
3636

3737
# UT for keras 2.3 need tensorflow <= 2.0.0
3838
Python37-tf200:

.azure-pipelines/win32-CI-keras-applications-nightly.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939

4040
Python37:
4141
python.version: '3.7'
42-
ONNX_PATH: onnx==1.8.0
42+
ONNX_PATH: onnx==1.9.0
4343
INSTALL_KERAS: pip install keras==2.3.1
4444
UNINSTALL_KERAS:
4545
INSTALL_TENSORFLOW: pip install tensorflow==1.14.0
@@ -61,11 +61,11 @@ jobs:
6161

6262
Python38-tf2:
6363
python.version: '3.8'
64-
ONNX_PATH: onnx==1.8.0
64+
ONNX_PATH: onnx==1.9.0
6565
INSTALL_KERAS:
6666
UNINSTALL_KERAS: pip uninstall keras -y
6767
INSTALL_TENSORFLOW: pip install tensorflow==2.2.0
68-
INSTALL_ORT: pip install onnxruntime==1.7.0
68+
INSTALL_ORT: pip install onnxruntime==1.8.0
6969
INSTALL_KERAS_RESNET: pip install keras-resnet
7070
INSTALL_TRANSFORMERS: pip install transformers==3.4.0
7171
NIGHTLY_BUILD_TEST: python run_all_v2.py

.azure-pipelines/win32-conda-CI-tf-keras.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ jobs:
3636
python.version: '3.8'
3737
ONNX_PATH: onnx==1.7.0
3838
TENSORFLOW_PATH: tensorflow-cpu==2.2.0
39-
INSTALL_ORT:
39+
INSTALL_ORT: pip install onnxruntime==1.6.0
4040

4141
Python38-tf2.3:
4242
python.version: '3.8'
43-
ONNX_PATH: onnx==1.8.0
43+
ONNX_PATH: onnx==1.9.0
4444
TENSORFLOW_PATH: tensorflow-cpu==2.3.0
45-
INSTALL_ORT: pip install onnxruntime==1.7.0
45+
INSTALL_ORT: pip install onnxruntime==1.8.0
4646

4747
maxParallel: 3
4848

.azure-pipelines/win32-conda-CI.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ jobs:
3838

3939
Python38-tf220:
4040
python.version: '3.8'
41-
ONNX_PATH: onnx==1.8.0
41+
ONNX_PATH: onnx==1.9.0
4242
KERAS: keras==2.4.3
4343
TENSORFLOW_PATH: tensorflow==2.2.0
44-
INSTALL_ORT:
44+
INSTALL_ORT: pip install onnxruntime==1.8.0
4545

4646
maxParallel: 3
4747

keras2onnx/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
keras2onnx
55
This package converts keras models into ONNX for use with any inference engine supporting ONNX
66
"""
7-
__version__ = "1.8.0"
7+
__version__ = "1.9.0"
88
__author__ = "Microsoft Corporation"
99
__producer__ = "keras2onnx"
1010

keras2onnx/_builtin.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,8 @@ def _convert_tf_fused_batch_norm_core(scope, operator, container):
796796
input_dim = len(_cal_tensor_shape(node.inputs[0]))
797797
epsilon = node.get_attr('epsilon')
798798
attrs = {'epsilon': epsilon, 'momentum': 0.9, 'spatial': 1}
799-
outputs_num = min(5, len(node.outputs))
799+
# ORT assumes opitonal outputs indicate training mode. So we should use one output for inference.
800+
outputs_num = 1
800801

801802
if _is_nhwc(node):
802803
input_perm = [0, input_dim - 1] + list(range(1, input_dim - 1))

keras2onnx/ke2onnx/batch_norm.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ def convert_keras_batch_normalization(scope, operator, container):
6565

6666
if skip_transpose:
6767
# If no transpose is required, we can simply use the output of ONNX BatchNorm as the final outcome
68-
apply_batch_norm(scope, input_tensor_names, operator.output_full_names[0:5], container,
68+
# ORT assumes opitonal outputs indicate training mode. So we should use one output for inference.
69+
apply_batch_norm(scope, input_tensor_names, operator.output_full_names[0], container,
6970
operator_name=operator.full_name, epsilon=epsilon, is_test=is_test,
7071
momentum=momentum, spatial=spatial)
7172
else:

requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ numpy
22
protobuf
33
requests
44
onnx
5-
onnxconverter-common>=1.8.0
5+
onnxconverter-common>=1.9.0
66
fire

0 commit comments

Comments
 (0)