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

Upgrade to opset 14 #723

Merged
merged 7 commits into from
Jun 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .azure-pipelines/linux-CI-keras-applications-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:

Python37:
python.version: '3.7.3'
ONNX_PATH: onnx==1.8.0
ONNX_PATH: onnx==1.9.0
INSTALL_KERAS: pip install keras==2.3.1
UNINSTALL_KERAS:
INSTALL_TENSORFLOW: pip install tensorflow==1.15.0
Expand All @@ -60,7 +60,7 @@ jobs:

Python38-tf2:
python.version: '3.8'
ONNX_PATH: onnx==1.8.0
ONNX_PATH: onnx==1.9.0
INSTALL_KERAS:
UNINSTALL_KERAS: pip uninstall keras -y
INSTALL_TENSORFLOW: pip install tensorflow==2.2.0
Expand Down
6 changes: 3 additions & 3 deletions .azure-pipelines/linux-conda-CI-tf-keras.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ jobs:
python.version: '3.8'
ONNX_PATH: onnx==1.7.0
TENSORFLOW_PATH: tensorflow-cpu==2.2.0
INSTALL_ORT:
INSTALL_ORT: pip install onnxruntime==1.6.0

Python38-tf2.3:
python.version: '3.8'
ONNX_PATH: onnx==1.8.0
ONNX_PATH: onnx==1.9.0
TENSORFLOW_PATH: tensorflow-cpu==2.3.0
INSTALL_ORT: pip install onnxruntime==1.7.0
INSTALL_ORT: pip install onnxruntime==1.8.0

maxParallel: 3

Expand Down
4 changes: 2 additions & 2 deletions .azure-pipelines/linux-conda-CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ jobs:

Python37-tf1150:
python.version: '3.7'
ONNX_PATH: onnx==1.8.0
ONNX_PATH: onnx==1.9.0
KERAS: keras==2.4.3
TENSORFLOW_PATH: tensorflow==1.15.0
INSTALL_ORT: pip install onnxruntime==1.6.0
INSTALL_ORT: pip install onnxruntime==1.8.0

# UT for keras 2.3 need tensorflow <= 2.0.0
Python37-tf200:
Expand Down
6 changes: 3 additions & 3 deletions .azure-pipelines/win32-CI-keras-applications-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:

Python37:
python.version: '3.7'
ONNX_PATH: onnx==1.8.0
ONNX_PATH: onnx==1.9.0
INSTALL_KERAS: pip install keras==2.3.1
UNINSTALL_KERAS:
INSTALL_TENSORFLOW: pip install tensorflow==1.14.0
Expand All @@ -61,11 +61,11 @@ jobs:

Python38-tf2:
python.version: '3.8'
ONNX_PATH: onnx==1.8.0
ONNX_PATH: onnx==1.9.0
INSTALL_KERAS:
UNINSTALL_KERAS: pip uninstall keras -y
INSTALL_TENSORFLOW: pip install tensorflow==2.2.0
INSTALL_ORT: pip install onnxruntime==1.7.0
INSTALL_ORT: pip install onnxruntime==1.8.0
INSTALL_KERAS_RESNET: pip install keras-resnet
INSTALL_TRANSFORMERS: pip install transformers==3.4.0
NIGHTLY_BUILD_TEST: python run_all_v2.py
Expand Down
6 changes: 3 additions & 3 deletions .azure-pipelines/win32-conda-CI-tf-keras.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ jobs:
python.version: '3.8'
ONNX_PATH: onnx==1.7.0
TENSORFLOW_PATH: tensorflow-cpu==2.2.0
INSTALL_ORT:
INSTALL_ORT: pip install onnxruntime==1.6.0

Python38-tf2.3:
python.version: '3.8'
ONNX_PATH: onnx==1.8.0
ONNX_PATH: onnx==1.9.0
TENSORFLOW_PATH: tensorflow-cpu==2.3.0
INSTALL_ORT: pip install onnxruntime==1.7.0
INSTALL_ORT: pip install onnxruntime==1.8.0

maxParallel: 3

Expand Down
4 changes: 2 additions & 2 deletions .azure-pipelines/win32-conda-CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ jobs:

Python38-tf220:
python.version: '3.8'
ONNX_PATH: onnx==1.8.0
ONNX_PATH: onnx==1.9.0
KERAS: keras==2.4.3
TENSORFLOW_PATH: tensorflow==2.2.0
INSTALL_ORT:
INSTALL_ORT: pip install onnxruntime==1.8.0

maxParallel: 3

Expand Down
2 changes: 1 addition & 1 deletion keras2onnx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
keras2onnx
This package converts keras models into ONNX for use with any inference engine supporting ONNX
"""
__version__ = "1.8.0"
__version__ = "1.9.0"
__author__ = "Microsoft Corporation"
__producer__ = "keras2onnx"

Expand Down
3 changes: 2 additions & 1 deletion keras2onnx/_builtin.py
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,8 @@ def _convert_tf_fused_batch_norm_core(scope, operator, container):
input_dim = len(_cal_tensor_shape(node.inputs[0]))
epsilon = node.get_attr('epsilon')
attrs = {'epsilon': epsilon, 'momentum': 0.9, 'spatial': 1}
outputs_num = min(5, len(node.outputs))
# ORT assumes opitonal outputs indicate training mode. So we should use one output for inference.
outputs_num = 1

if _is_nhwc(node):
input_perm = [0, input_dim - 1] + list(range(1, input_dim - 1))
Expand Down
3 changes: 2 additions & 1 deletion keras2onnx/ke2onnx/batch_norm.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ def convert_keras_batch_normalization(scope, operator, container):

if skip_transpose:
# If no transpose is required, we can simply use the output of ONNX BatchNorm as the final outcome
apply_batch_norm(scope, input_tensor_names, operator.output_full_names[0:5], container,
# ORT assumes opitonal outputs indicate training mode. So we should use one output for inference.
apply_batch_norm(scope, input_tensor_names, operator.output_full_names[0], container,
operator_name=operator.full_name, epsilon=epsilon, is_test=is_test,
momentum=momentum, spatial=spatial)
else:
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ numpy
protobuf
requests
onnx
onnxconverter-common>=1.8.0
onnxconverter-common>=1.9.0
fire