Skip to content

Commit d071d17

Browse files
authored
Change the default opset to 15. (#2145)
* Change the default opset to 15. * Update the ONNX version for one CI test. Signed-off-by: Jay Zhang <[email protected]>
1 parent 25ebdee commit d071d17

File tree

6 files changed

+18
-14
lines changed

6 files changed

+18
-14
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ The common issues we run into we try to document here [Troubleshooting Guide](Tr
1717

1818
| Build Type | OS | Python | TensorFlow | ONNX opset | Status |
1919
| --- | --- | --- | --- | --- | --- |
20-
| Unit Test - Basic | Linux, MacOS<sup>\*</sup>, Windows<sup>\*</sup> | 3.7-3.10 | 1.13-1.15, 2.1-2.10 | 13-17 | [![Build Status](https://dev.azure.com/tensorflow-onnx/tensorflow-onnx/_apis/build/status/unit_test?branchName=main)](https://dev.azure.com/tensorflow-onnx/tensorflow-onnx/_build/latest?definitionId=16&branchName=main) |
21-
| Unit Test - Full | Linux, MacOS, Windows | 3.7-3.10 | 1.13-1.15, 2.1-2.10 | 13-17 | [![Build Status](https://dev.azure.com/tensorflow-onnx/tensorflow-onnx/_apis/build/status/unit_test-matrix?branchName=main)](https://dev.azure.com/tensorflow-onnx/tensorflow-onnx/_build/latest?definitionId=18&branchName=main) | |
20+
| Unit Test - Basic | Linux, MacOS<sup>\*</sup>, Windows<sup>\*</sup> | 3.7-3.10 | 1.13-1.15, 2.1-2.10 | 14-18 | [![Build Status](https://dev.azure.com/tensorflow-onnx/tensorflow-onnx/_apis/build/status/unit_test?branchName=main)](https://dev.azure.com/tensorflow-onnx/tensorflow-onnx/_build/latest?definitionId=16&branchName=main) |
21+
| Unit Test - Full | Linux, MacOS, Windows | 3.7-3.10 | 1.13-1.15, 2.1-2.10 | 14-18 | [![Build Status](https://dev.azure.com/tensorflow-onnx/tensorflow-onnx/_apis/build/status/unit_test-matrix?branchName=main)](https://dev.azure.com/tensorflow-onnx/tensorflow-onnx/_build/latest?definitionId=18&branchName=main) | |
2222
<br/>
2323

2424
## Supported Versions
@@ -27,10 +27,10 @@ The common issues we run into we try to document here [Troubleshooting Guide](Tr
2727

2828
tf2onnx will use the ONNX version installed on your system and installs the latest ONNX version if none is found.
2929

30-
We support and test ONNX opset-13 to opset-17. opset-6 to opset-12 should work but we don't test them.
31-
By default we use ```opset-13``` for the resulting ONNX graph.
30+
We support and test ONNX opset-14 to opset-18. opset-6 to opset-13 should work but we don't test them.
31+
By default we use ```opset-15``` for the resulting ONNX graph.
3232

33-
If you want the graph to be generated with a specific opset, use ```--opset``` in the command line, for example ```--opset 13```.
33+
If you want the graph to be generated with a specific opset, use ```--opset``` in the command line, for example ```--opset 15```.
3434

3535
### TensorFlow
3636

@@ -97,9 +97,9 @@ To get started with `tensorflow-onnx`, run the `t2onnx.convert` command, providi
9797

9898
```python -m tf2onnx.convert --saved-model tensorflow-model-path --output model.onnx```
9999

100-
The above command uses a default of `13` for the ONNX opset. If you need a newer opset, or want to limit your model to use an older opset then you can provide the `--opset` argument to the command. If you are unsure about which opset to use, refer to the [ONNX operator documentation](https://github.com/onnx/onnx/releases).
100+
The above command uses a default of `15` for the ONNX opset. If you need a newer opset, or want to limit your model to use an older opset then you can provide the `--opset` argument to the command. If you are unsure about which opset to use, refer to the [ONNX operator documentation](https://github.com/onnx/onnx/releases).
101101

102-
```python -m tf2onnx.convert --saved-model tensorflow-model-path --opset 17 --output model.onnx```
102+
```python -m tf2onnx.convert --saved-model tensorflow-model-path --opset 18 --output model.onnx```
103103

104104
If your TensorFlow model is in a format other than `saved model`, then you need to provide the inputs and outputs of the model graph.
105105

@@ -192,7 +192,7 @@ ONNX requires default values for graph inputs to be constant, while Tensorflow's
192192

193193
#### --opset
194194

195-
By default we use the opset 13 to generate the graph. By specifying ```--opset``` the user can override the default to generate a graph with the desired opset. For example ```--opset 17``` would create a onnx graph that uses only ops available in opset 17. Because older opsets have in most cases fewer ops, some models might not convert on a older opset.
195+
By default we use the opset 15 to generate the graph. By specifying ```--opset``` the user can override the default to generate a graph with the desired opset. For example ```--opset 17``` would create a onnx graph that uses only ops available in opset 17. Because older opsets have in most cases fewer ops, some models might not convert on an older opset.
196196

197197
#### --dequantize
198198

ci_build/azure_pipelines/keras2onnx_application_tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,9 @@ jobs:
105105
INSTALL_NUMPY:
106106
NIGHTLY_BUILD_TEST: python run_all_v2.py
107107

108-
Python310-onnx1.13-tf2.9:
108+
Python310-onnx1.12-tf2.9:
109109
python.version: '3.10'
110-
ONNX_PATH: onnx==1.13.0
110+
ONNX_PATH: onnx==1.12.0
111111
INSTALL_KERAS:
112112
UNINSTALL_KERAS:
113113
INSTALL_TENSORFLOW: pip install tensorflow==2.9.0

ci_build/azure_pipelines/templates/job_generator.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ parameters:
55
python_versions: ['3.7']
66
tf_versions: ['']
77
onnx_versions: ['1.13.1']
8-
onnx_opsets: ['18', '17', '16', '15', '14', '13']
8+
onnx_opsets: ['18', '17', '16', '15', '14']
99
onnx_backends: {onnxruntime: ['1.14.1']}
1010
job: {}
1111
run_setup: 'True'

ci_build/azure_pipelines/templates/setup.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ steps:
7070
if [[ $CI_TF_VERSION == 2.9* ]] ;
7171
then
7272
pip install "tensorflow-text>=2.9,<2.10"
73+
fi
74+
if [[ $CI_TF_VERSION == 2.10* ]] || [[ $CI_TF_VERSION == 2.11* ]] ;
75+
then
76+
pip install "tensorflow-text>=2.10,<2.12"
7377
else
7478
pip install tensorflow-text
7579
fi

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: ['18', '17', '16', '15', '14', '13']
4+
onnx_opsets: ['18', '17', '16', '15', '14']
55
skip_tflite_tests: 'True'
66
skip_tfjs_tests: 'True'
77
skip_tf_tests: 'False'

tf2onnx/constants.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
# Default opset version for onnx domain.
1919
# The current update policy is that the default should be set to
2020
# the latest released version as of 18 months ago.
21-
# Opset 13 was released in ONNX v1.8.0 (Nov, 2020).
22-
PREFERRED_OPSET = 13
21+
# Opset 15 was released in ONNX v1.10.0 (Jul, 2021).
22+
PREFERRED_OPSET = 15
2323

2424
# Default opset for custom ops
2525
TENSORFLOW_OPSET = helper.make_opsetid("ai.onnx.converters.tensorflow", 1)

0 commit comments

Comments
 (0)