Skip to content

Try tf 2.18 (version 2) #2385

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 29 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
remove 3.12
Signed-off-by: xadupre <[email protected]>
  • Loading branch information
xadupre committed Feb 4, 2025
commit 04d0b80b3a5b34c98618b0498899772ab0d80b74
6 changes: 0 additions & 6 deletions .github/workflows/keras_application_test_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ jobs:
- 'py39-tf2.15'
- 'py310-tf2.18'
- 'py311-tf2.18'
- 'py312-tf2.18'
os: ['ubuntu-latest', 'windows-2022']
include:
- name: 'py38-tf2.13'
Expand All @@ -119,11 +118,6 @@ jobs:
python_version: '3.11'
ort_version: '1.20.1'
onnx_version: '1.17.0'
- name: 'py312-tf2.18'
tf_version: '2.18.0'
python_version: '3.12'
ort_version: '1.20.1'
onnx_version: '1.17.0'
runs-on: ${{ matrix.os }}

steps:
Expand Down
32 changes: 1 addition & 31 deletions .github/workflows/keras_unit_test_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,30 +86,6 @@ jobs:
name: Test Results (Py311-TF2.18-ubuntu)
path: ./**/test-results-*.xml

Test2_py312_tf2_18: # Do not change this name because it is used in Ruleset of this repo.
strategy:
fail-fast: false
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Run Tests (Py312-TF2.18)
uses: ./.github/actions/keras_unit_test
with:
tf_version: '2.18.0'
python_version: '3.12'
ort_version: '1.20.1'
onnx_version: '1.17.0'

- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v4
with:
name: Test Results (Py312-TF2.18-ubuntu)
path: ./**/test-results-*.xml

Test2_py37_with_tf1_15: # Do not change this name because it is used in Ruleset of this repo.
strategy:
fail-fast: false
Expand Down Expand Up @@ -143,7 +119,6 @@ jobs:
- 'py39-tf2.15'
- 'py310-tf2.18'
- 'py311-tf2.18'
- 'py312-tf2.18'
os: ['ubuntu-latest', 'windows-2022']
include:
- name: 'py38-tf2.13'
Expand All @@ -166,11 +141,6 @@ jobs:
python_version: '3.11'
ort_version: '1.20.1'
onnx_version: '1.17.0'
- name: 'py312-tf2.18'
tf_version: '2.18.0'
python_version: '3.12'
ort_version: '1.20.1'
onnx_version: '1.17.0'
runs-on: ${{ matrix.os }}

steps:
Expand All @@ -193,7 +163,7 @@ jobs:

publish-test-results:
name: "Publish Tests Results to Github"
needs: [Test2_py38_tf2_9, Test2_py310_tf2_18, Test2_py311_tf2_18, Test2_py312_tf2_18, Test2_py37_with_tf1_15, Extra_tests2]
needs: [Test2_py38_tf2_9, Test2_py310_tf2_18, Test2_py311_tf2_18, Test2_py37_with_tf1_15, Extra_tests2]
runs-on: ubuntu-latest
permissions:
checks: write
Expand Down
35 changes: 1 addition & 34 deletions .github/workflows/pretrained_model_test_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,33 +69,6 @@ jobs:
name: Test Results (Py310-TF2.18-18-ubuntu)
path: ./**/test-results-*.xml

Test3_py312_tf2_18: # Do not change this name because it is used in 'publish-test-results' section below.
strategy:
fail-fast: false
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Run Tests (Py312-TF2.18-18)
uses: ./.github/actions/pretrained_model_test
with:
os: 'ubuntu-latest'
tf_version: '2.18.0'
python_version: '3.12'
ort_version: '1.20.1'
onnx_version: '1.17.0'
opset_version: '18'
skip_tflite: 'False'

- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v4
with:
name: Test Results (Py312-TF2.18-18-ubuntu)
path: ./**/test-results-*.xml

Test3_py37_with_tf1_15: # Do not change this name because it is used in 'publish-test-results' section below.
strategy:
fail-fast: false
Expand Down Expand Up @@ -131,7 +104,6 @@ jobs:
- 'py39-tf2.15'
- 'py310-tf2.18'
- 'py311-tf2.18'
- 'py312-tf2.18'
os: ['ubuntu-latest', 'windows-2022']
opset_version: ['18', '15']
skip_tflite: ['False']
Expand All @@ -156,11 +128,6 @@ jobs:
python_version: '3.11'
ort_version: '1.20.1'
onnx_version: '1.17.0'
- name: 'py312-tf2.18'
tf_version: '2.18.0'
python_version: '3.12'
ort_version: '1.20.1'
onnx_version: '1.17.0'
runs-on: ${{ matrix.os }}

steps:
Expand All @@ -186,7 +153,7 @@ jobs:

publish-test-results:
name: "Publish Tests Results to Github"
needs: [Test3_py38_tf2_9, Test3_py310_tf2_18, Test3_py312_tf2_18, Test3_py37_with_tf1_15, Extra_tests3]
needs: [Test3_py38_tf2_9, Test3_py310_tf2_18, Test3_py37_with_tf1_15, Extra_tests3]
runs-on: ubuntu-latest
permissions:
checks: write
Expand Down
35 changes: 1 addition & 34 deletions .github/workflows/unit_test_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,33 +96,6 @@ jobs:
name: Test Results (Py311-TF2.18-18-ubuntu)
path: ./**/test-results-*.xml

Test4_py312_tf2_18: # Do not change this name because it is used in Ruleset of this repo.
strategy:
fail-fast: false
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Run Tests (Py312-TF2.18-18)
uses: ./.github/actions/unit_test
with:
os: 'ubuntu-latest'
tf_version: '2.18.0'
python_version: '3.12'
ort_version: '1.20.1'
onnx_version: '1.17.0'
opset_version: '18'
skip_tflite: 'False'

- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v4
with:
name: Test Results (Py312-TF2.18-18-ubuntu)
path: ./**/test-results-*.xml

Extra_tests4:
strategy:
fail-fast: false
Expand All @@ -132,16 +105,10 @@ jobs:
- 'py39-tf2.15'
- 'py310-tf2.18'
- 'py311-tf2.18'
- 'py312-tf2.18'
os: ['ubuntu-latest', 'windows-2022']
opset_version: ['18', '15']
skip_tflite: ['False']
include:
- name: 'py312-tf2.18'
tf_version: '2.18.0'
python_version: '3.12'
ort_version: '1.20.1'
onnx_version: '1.17.0'
- name: 'py311-tf2.18'
tf_version: '2.18.0'
python_version: '3.11'
Expand Down Expand Up @@ -196,7 +163,7 @@ jobs:

publish-test-results:
name: "Publish Tests Results to Github"
needs: [Test4_py38_tf2_9, Test4_py310_tf2_18, Test4_py311_tf2_18, Test4_py312_tf2_18, Extra_tests4]
needs: [Test4_py38_tf2_9, Test4_py310_tf2_18, Test4_py311_tf2_18, Extra_tests4]
runs-on: ubuntu-latest
permissions:
checks: write
Expand Down
6 changes: 3 additions & 3 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, Windows | 3.7-3.12 | 1.15, 2.9-2.15 | 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, Windows | 3.7-3.12 | 1.15, 2.9-2.15 | 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) | |
| Unit Test - Basic | Linux, Windows | 3.7-3.11 | 1.15, 2.9-2.15 | 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, Windows | 3.7-3.11 | 1.15, 2.9-2.15 | 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 @@ -42,7 +42,7 @@ You can install tf2onnx on top of tf-1.x or tf-2.x.

### Python

We support Python ```3.7-3.12```.
We support Python ```3.7-3.11```.

## Prerequisites

Expand Down
6 changes: 4 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def run(self):
author='ONNX',
author_email='[email protected]',
url='https://github.com/onnx/tensorflow-onnx',
install_requires=['numpy>=1.14.1', 'onnx>=1.4.1', 'requests', 'six', 'flatbuffers>=1.12', 'protobuf~=3.20'],
install_requires=['numpy>=1.14.1', 'onnx>=1.4.1', 'requests', 'six', 'flatbuffers>=1.12'],
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
Expand All @@ -98,5 +98,7 @@ def run(self):
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10']
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
]
)
2 changes: 1 addition & 1 deletion tests/test_cudnn_compatible_gru.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# pylint: disable=missing-docstring,invalid-name,unused-argument,using-constant-test,cell-var-from-loop

if is_tf2():
MultiRNNCell = tf.compat.v1.nn.rnn_cell.MultiRNNCell
MultiRNNCell = getattr(tf.compat.v1.nn.rnn_cell, "MultiRNNCell", None)
dynamic_rnn = tf.compat.v1.nn.dynamic_rnn
bidirectional_dynamic_rnn = tf.compat.v1.nn.bidirectional_dynamic_rnn
else:
Expand Down
10 changes: 5 additions & 5 deletions tests/test_custom_rnncell.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
# pylint: disable=abstract-method,arguments-differ

if is_tf2():
BasicLSTMCell = tf.compat.v1.nn.rnn_cell.BasicLSTMCell
LSTMCell = tf.compat.v1.nn.rnn_cell.LSTMCell
GRUCell = tf.compat.v1.nn.rnn_cell.GRUCell
RNNCell = tf.compat.v1.nn.rnn_cell.RNNCell
MultiRNNCell = tf.compat.v1.nn.rnn_cell.MultiRNNCell
BasicLSTMCell = getattr(tf.compat.v1.nn.rnn_cell, "BasicLSTMCell", None)
LSTMCell = getattr(tf.compat.v1.nn.rnn_cell, "LSTMCell", None)
GRUCell = getattr(tf.compat.v1.nn.rnn_cell, "GRUCell", None)
RNNCell = getattr(tf.compat.v1.nn.rnn_cell, "RNNCell", None)
MultiRNNCell = getattr(tf.compat.v1.nn.rnn_cell, "MultiRNNCell", None)
dynamic_rnn = tf.compat.v1.nn.dynamic_rnn
bidirectional_dynamic_rnn = tf.compat.v1.nn.bidirectional_dynamic_rnn
else:
Expand Down
8 changes: 4 additions & 4 deletions tests/test_gru.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@

if is_tf2():
# There is no LSTMBlockCell in tf-2.x
BasicLSTMCell = tf.compat.v1.nn.rnn_cell.BasicLSTMCell
LSTMCell = tf.compat.v1.nn.rnn_cell.LSTMCell
GRUCell = tf.compat.v1.nn.rnn_cell.GRUCell
MultiRNNCell = tf.compat.v1.nn.rnn_cell.MultiRNNCell
BasicLSTMCell = getattr(tf.compat.v1.nn.rnn_cell, "BasicLSTMCell", None)
LSTMCell = getattr(tf.compat.v1.nn.rnn_cell, "LSTMCell", None)
GRUCell = getattr(tf.compat.v1.nn.rnn_cell, "GRUCell", None)
MultiRNNCell = getattr(tf.compat.v1.nn.rnn_cell, "MultiRNNCell", None)
dynamic_rnn = tf.compat.v1.nn.dynamic_rnn
bidirectional_dynamic_rnn = tf.compat.v1.nn.bidirectional_dynamic_rnn
else:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_grublock.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# pylint: disable=invalid-name

if is_tf2():
MultiRNNCell = tf.compat.v1.nn.rnn_cell.MultiRNNCell
MultiRNNCell = getattr(tf.compat.v1.nn.rnn_cell, "MultiRNNCell", None)
dynamic_rnn = tf.compat.v1.nn.dynamic_rnn
bidirectional_dynamic_rnn = tf.compat.v1.nn.bidirectional_dynamic_rnn
else:
Expand Down
6 changes: 3 additions & 3 deletions tests/test_lstm.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@

if is_tf2():
# There is no LSTMBlockCell in tf-2.x
BasicLSTMCell = tf.compat.v1.nn.rnn_cell.BasicLSTMCell
LSTMCell = tf.compat.v1.nn.rnn_cell.LSTMCell
MultiRNNCell = tf.compat.v1.nn.rnn_cell.MultiRNNCell
BasicLSTMCell = getattr(tf.compat.v1.nn.rnn_cell, "BasicLSTMCell", None)
LSTMCell = getattr(tf.compat.v1.nn.rnn_cell, "LSTMCell", None)
MultiRNNCell = getattr(tf.compat.v1.nn.rnn_cell, "MultiRNNCell", None)
dynamic_rnn = tf.compat.v1.nn.dynamic_rnn
bidirectional_dynamic_rnn = tf.compat.v1.nn.bidirectional_dynamic_rnn
else:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_lstmblock.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

if is_tf2():
# There is no LSTMBlockCell in tf-2.x
MultiRNNCell = tf.compat.v1.nn.rnn_cell.MultiRNNCell
MultiRNNCell = getattr(tf.compat.v1.nn.rnn_cell, "MultiRNNCell", None)
dynamic_rnn = tf.compat.v1.nn.dynamic_rnn
bidirectional_dynamic_rnn = tf.compat.v1.nn.bidirectional_dynamic_rnn
else:
Expand Down
10 changes: 5 additions & 5 deletions tests/test_seq2seq.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
# pylint: disable=invalid-name

if is_tf2():
BasicLSTMCell = tf.compat.v1.nn.rnn_cell.BasicLSTMCell
LSTMCell = tf.compat.v1.nn.rnn_cell.LSTMCell
RNNCell = tf.compat.v1.nn.rnn_cell.RNNCell
MultiRNNCell = tf.compat.v1.nn.rnn_cell.MultiRNNCell
BasicLSTMCell = getattr(tf.compat.v1.nn.rnn_cell, "BasicLSTMCell", None)
LSTMCell = getattr(tf.compat.v1.nn.rnn_cell, "LSTMCell", None)
RNNCell = getattr(tf.compat.v1.nn.rnn_cell, "RNNCell", None)
MultiRNNCell = getattr(tf.compat.v1.nn.rnn_cell, "MultiRNNCell", None)
dynamic_rnn = tf.compat.v1.nn.dynamic_rnn
bidirectional_dynamic_rnn = tf.compat.v1.nn.bidirectional_dynamic_rnn
LSTMStateTuple = tf.compat.v1.nn.rnn_cell.LSTMStateTuple
LSTMStateTuple = getattr(tf.compat.v1.nn.rnn_cell, "LSTMStateTuple", None)
else:
LSTMCell = tf.contrib.rnn.LSTMCell
LSTMBlockCell = tf.contrib.rnn.LSTMBlockCell
Expand Down
4 changes: 2 additions & 2 deletions tests/test_stacked_lstm.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
# pylint: disable=invalid-name

if is_tf2():
LSTMCell = tf.compat.v1.nn.rnn_cell.LSTMCell
MultiRNNCell = tf.compat.v1.nn.rnn_cell.MultiRNNCell
LSTMCell = getattr(tf.compat.v1.nn.rnn_cell, "LSTMCell", None)
MultiRNNCell = getattr(tf.compat.v1.nn.rnn_cell, "MultiRNNCell", None)
dynamic_rnn = tf.compat.v1.nn.dynamic_rnn
else:
LSTMCell = tf.contrib.rnn.LSTMCell
Expand Down
Loading