Skip to content
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
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ The common issues we run into we try to document here [Troubleshooting Guide](Tr

| Build Type | OS | Python | TensorFlow | ONNX opset | Status |
| --- | --- | --- | --- | --- | --- |
| 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) |
| 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) | |
| 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) |
| 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) | |
<br/>

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

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

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

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

### TensorFlow

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

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

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).
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).

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

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.

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

#### --opset

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.
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.

#### --dequantize

Expand Down
4 changes: 2 additions & 2 deletions ci_build/azure_pipelines/keras2onnx_application_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ jobs:
INSTALL_NUMPY:
NIGHTLY_BUILD_TEST: python run_all_v2.py

Python310-onnx1.13-tf2.9:
Python310-onnx1.12-tf2.9:
python.version: '3.10'
ONNX_PATH: onnx==1.13.0
ONNX_PATH: onnx==1.12.0
INSTALL_KERAS:
UNINSTALL_KERAS:
INSTALL_TENSORFLOW: pip install tensorflow==2.9.0
Expand Down
2 changes: 1 addition & 1 deletion ci_build/azure_pipelines/templates/job_generator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ parameters:
python_versions: ['3.7']
tf_versions: ['']
onnx_versions: ['1.13.1']
onnx_opsets: ['18', '17', '16', '15', '14', '13']
onnx_opsets: ['18', '17', '16', '15', '14']
onnx_backends: {onnxruntime: ['1.14.1']}
job: {}
run_setup: 'True'
Expand Down
4 changes: 4 additions & 0 deletions ci_build/azure_pipelines/templates/setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ steps:
if [[ $CI_TF_VERSION == 2.9* ]] ;
then
pip install "tensorflow-text>=2.9,<2.10"
fi
if [[ $CI_TF_VERSION == 2.10* ]] || [[ $CI_TF_VERSION == 2.11* ]] ;
then
pip install "tensorflow-text>=2.10,<2.12"
else
pip install tensorflow-text
fi
Expand Down
2 changes: 1 addition & 1 deletion ci_build/azure_pipelines/templates/unit_test.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Run unit test

parameters:
onnx_opsets: ['18', '17', '16', '15', '14', '13']
onnx_opsets: ['18', '17', '16', '15', '14']
skip_tflite_tests: 'True'
skip_tfjs_tests: 'True'
skip_tf_tests: 'False'
Expand Down
4 changes: 2 additions & 2 deletions tf2onnx/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
# Default opset version for onnx domain.
# The current update policy is that the default should be set to
# the latest released version as of 18 months ago.
# Opset 13 was released in ONNX v1.8.0 (Nov, 2020).
PREFERRED_OPSET = 13
# Opset 15 was released in ONNX v1.10.0 (Jul, 2021).
PREFERRED_OPSET = 15

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