Skip to content

Commit da324a5

Browse files
authored
tf-2.6 to ci, reflect tf-2.6 in readme (#1680)
* tf-2.6 to ci, reflect tf-2.6 in readme Signed-off-by: Guenther Schmuelling <[email protected]> * remove tflite/tfjs 2.6 for now Signed-off-by: Guenther Schmuelling <[email protected]> * clear session since we run models in process back to back Signed-off-by: Guenther Schmuelling <[email protected]>
1 parent e9a05d0 commit da324a5

File tree

9 files changed

+325
-247
lines changed

9 files changed

+325
-247
lines changed

README.md

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
<!--- SPDX-License-Identifier: Apache-2.0 -->
22

3-
# tf2onnx - Convert TensorFlow, Keras and Tflite models to ONNX.
3+
# tf2onnx - Convert TensorFlow, Keras, Tensorflow.js and Tflite models to ONNX.
44

5-
tf2onnx converts TensorFlow (tf-1.x or tf-2.x), tf.keras and tflite models to ONNX via command
5+
tf2onnx converts TensorFlow (tf-1.x or tf-2.x), keras, tensorflow.js and tflite models to ONNX via command
66
line or python api.
77

8-
__Note: after tf2onnx-1.8.3 we made a change that impacts the output names for the ONNX model.
9-
Instead of taking the output names from the tensorflow graph (ie. for keras models this is frequently Identity:0) we decided that it is better to use the structured output names of the model so the output names are now identical to the names in the keras or saved model.__
8+
__Note: tensorflow.js support was just added. While we tested it with many tfjs models from tfhub, it should be considered experimental.__
109

1110
TensorFlow has many more ops than ONNX and occasionally mapping a model to ONNX creates issues.
1211

@@ -18,8 +17,8 @@ The common issues we run into we try to document here [Troubleshooting Guide](Tr
1817

1918
| Build Type | OS | Python | Tensorflow | ONNX opset | Status |
2019
| --- | --- | --- | --- | --- | --- |
21-
| Unit Test - Basic | Linux, MacOS<sup>\*</sup>, Windows<sup>\*</sup> | 3.6-3.9 | 1.12-1.15, 2.1-2.5 | 8-14 | [![Build Status](https://dev.azure.com/tensorflow-onnx/tensorflow-onnx/_apis/build/status/unit_test?branchName=master)](https://dev.azure.com/tensorflow-onnx/tensorflow-onnx/_build/latest?definitionId=16&branchName=master) |
22-
| Unit Test - Full | Linux, MacOS, Windows | 3.6-3.9 | 1.12-1.15, 2.1-2.5 | 8-14 | [![Build Status](https://dev.azure.com/tensorflow-onnx/tensorflow-onnx/_apis/build/status/unit_test-matrix?branchName=master)](https://dev.azure.com/tensorflow-onnx/tensorflow-onnx/_build/latest?definitionId=18&branchName=master) | |
20+
| Unit Test - Basic | Linux, MacOS<sup>\*</sup>, Windows<sup>\*</sup> | 3.6-3.9 | 1.12-1.15, 2.1-2.6 | 8-14 | [![Build Status](https://dev.azure.com/tensorflow-onnx/tensorflow-onnx/_apis/build/status/unit_test?branchName=master)](https://dev.azure.com/tensorflow-onnx/tensorflow-onnx/_build/latest?definitionId=16&branchName=master) |
21+
| Unit Test - Full | Linux, MacOS, Windows | 3.6-3.9 | 1.12-1.15, 2.1-2.6 | 8-14 | [![Build Status](https://dev.azure.com/tensorflow-onnx/tensorflow-onnx/_apis/build/status/unit_test-matrix?branchName=master)](https://dev.azure.com/tensorflow-onnx/tensorflow-onnx/_build/latest?definitionId=18&branchName=master) | |
2322
<br/>
2423

2524
## Supported Versions
@@ -127,7 +126,8 @@ We recently added support for tflite. You convert ```tflite``` models via comman
127126
python -m tf2onnx.convert
128127
--saved-model SOURCE_SAVED_MODEL_PATH |
129128
--checkpoint SOURCE_CHECKPOINT_METAFILE_PATH |
130-
--tflite SOURCE_TFLITE_PATH |
129+
--tflite TFLITE_MODEL_PATH |
130+
--tfjs TFJS_MODEL_PATH |
131131
--input | --graphdef SOURCE_GRAPHDEF_PB
132132
--output TARGET_ONNX_MODEL
133133
[--inputs GRAPH_INPUTS]
@@ -157,14 +157,18 @@ TensorFlow model as saved_model. We expect the path to the saved_model directory
157157

158158
TensorFlow model as checkpoint. We expect the path to the .meta file.
159159

160-
#### --tflite
161-
162-
Convert a tflite model by providing a path to the .tflite file. Inputs/outputs do not need to be specified.
163-
164160
#### --input or --graphdef
165161

166162
TensorFlow model as graphdef file.
167163

164+
#### --tfjs
165+
166+
Convert a tensorflow.js model by providing a path to the .tfjs file. Inputs/outputs do not need to be specified.
167+
168+
#### --tflite
169+
170+
Convert a tflite model by providing a path to the .tflite file. Inputs/outputs do not need to be specified.
171+
168172
#### --output
169173

170174
The target onnx file path.
@@ -260,7 +264,6 @@ optional arguments:
260264
--opset OPSET target opset to use
261265
--perf csv-file capture performance numbers for tensorflow and onnx runtime
262266
--debug dump generated graph with shape info
263-
--fold_const when set, TensorFlow fold_constants transformation will be applied before conversion. This will benefit features including Transpose optimization (e.g. Transpose operations introduced during tf-graph-to-onnx-graph conversion will be removed), and RNN unit conversion (for example LSTM).
264267
```
265268
```run_pretrained_models.py``` will run the TensorFlow model, captures the TensorFlow output and runs the same test against the specified ONNX backend after converting the model.
266269

ci_build/azure_pipelines/onnxruntime_nightly_test.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,18 @@ stages:
7676
- template: 'unit_test.yml'
7777
report_coverage: 'True'
7878

79+
- template: 'templates/job_generator.yml'
80+
parameters:
81+
platforms: ['linux']
82+
python_versions: ['3.9']
83+
tf_versions: ['2.6.0']
84+
onnx_opsets: ['']
85+
onnx_backends: {onnxruntime: ['nightly']}
86+
job:
87+
steps:
88+
- template: 'unit_test.yml'
89+
report_coverage: 'True'
90+
7991
- template: 'templates/job_generator.yml'
8092
parameters:
8193
platforms: ['windows']

ci_build/azure_pipelines/pretrained_model_test-matrix.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,15 @@ jobs:
3737
steps:
3838
- template: 'pretrained_model_test.yml'
3939

40+
- template: 'templates/job_generator.yml'
41+
parameters:
42+
platforms: ['linux', 'windows']
43+
python_versions: ['3.9']
44+
tf_versions: ['2.6.0']
45+
job:
46+
steps:
47+
- template: 'pretrained_model_test.yml'
48+
4049
schedules:
4150
- cron: "0 10 * * *"
4251
displayName: pre-trained model test, full matrix

ci_build/azure_pipelines/pretrained_model_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- template: 'templates/job_generator.yml'
1616
parameters:
1717
python_versions: ['3.7']
18-
tf_versions: ['1.15.5','2.4.1']
18+
tf_versions: ['1.15.5','2.6.0']
1919
job:
2020
steps:
2121
- template: 'pretrained_model_test.yml'

ci_build/azure_pipelines/unit_test-matrix.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,15 @@ stages:
4747
- template: 'unit_test.yml'
4848
report_coverage: 'True'
4949

50+
- template: 'templates/job_generator.yml'
51+
parameters:
52+
platforms: ['linux', 'windows']
53+
python_versions: ['3.8']
54+
tf_versions: ['2.6.0']
55+
onnx_opsets: ['']
56+
job:
57+
steps:
58+
- template: 'unit_test.yml'
59+
report_coverage: 'True'
60+
5061
- template: 'templates/combine_test_coverage.yml'

ci_build/azure_pipelines/unit_test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ stages:
5656
# tf 1.12
5757
python_versions: [3.6']
5858
tf_versions: ['1.12.3']
59-
onnx_opsets: ['']
59+
onnx_opsets: ['9']
6060
job:
6161
steps:
6262
- template: 'unit_test.yml'
@@ -66,7 +66,7 @@ stages:
6666
parameters:
6767
platforms: ['windows']
6868
tf_versions: ['1.14.0']
69-
onnx_opsets: ['']
69+
onnx_opsets: ['14']
7070
job:
7171
steps:
7272
- template: 'unit_test.yml'
@@ -77,7 +77,7 @@ stages:
7777
python_versions: ['3.7']
7878
platforms: ['windows']
7979
tf_versions: ['2.4.1']
80-
onnx_opsets: ['']
80+
onnx_opsets: ['13']
8181
job:
8282
steps:
8383
- template: 'unit_test.yml'

0 commit comments

Comments
 (0)