Skip to content

Commit df57e4b

Browse files
authored
CI pipeline upgrade. (#2171)
* Limite the protobuf version to 3.20.x. * Choose the correct opset version for tests. --------- Signed-off-by: Jay Zhang <[email protected]>
1 parent 256dd5c commit df57e4b

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

ci_build/azure_pipelines/trimmed_keras2onnx_application_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747

4848
Python38-tf2-2.11:
4949
python.version: '3.9'
50-
ONNX_PATH: onnx==1.13.1
50+
ONNX_PATH: onnx==1.14
5151
INSTALL_KERAS:
5252
UNINSTALL_KERAS:
5353
INSTALL_TENSORFLOW: pip install tensorflow==2.11.0

ci_build/azure_pipelines/trimmed_keras2onnx_unit_test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525

2626
Python310-tf-latest:
2727
python.version: '3.10'
28-
ONNX_PATH: onnx==1.13.1
28+
ONNX_PATH: onnx==1.14
2929
TENSORFLOW_PATH: tensorflow==2.11.0
3030
INSTALL_ORT: pip install onnxruntime==1.13.1
3131
INSTALL_NUMPY:
@@ -66,7 +66,7 @@ jobs:
6666

6767
Python310-tf-latest:
6868
python.version: '3.10'
69-
ONNX_PATH: onnx==1.13.1
69+
ONNX_PATH: onnx==1.14
7070
TENSORFLOW_PATH: tensorflow==2.11.0
7171
INSTALL_ORT: pip install onnxruntime==1.14.1
7272
INSTALL_NUMPY:

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def run(self):
8282
author='ONNX',
8383
author_email='[email protected]',
8484
url='https://github.com/onnx/tensorflow-onnx',
85-
install_requires=['numpy>=1.14.1', 'onnx>=1.4.1', 'requests', 'six', 'flatbuffers<3.0,>=1.12'],
85+
install_requires=['numpy>=1.14.1', 'onnx>=1.4.1', 'requests', 'six', 'flatbuffers<3.0,>=1.12', 'protobuf~=3.20.2'],
8686
classifiers=[
8787
'Development Status :: 5 - Production/Stable',
8888
'Intended Audience :: Developers',

tests/keras2onnx_applications/nightly_build/test_chatbot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from mock_keras2onnx.proto.tfcompat import is_tf2
1010
from os.path import dirname, abspath
1111
sys.path.insert(0, os.path.join(dirname(abspath(__file__)), '../../keras2onnx_tests/'))
12-
from test_utils import run_keras_and_ort, test_level_0
12+
from test_utils import run_keras_and_ort, test_level_0, get_max_opset_supported_for_test
1313
K = keras.backend
1414

1515
Activation = keras.layers.Activation
@@ -96,7 +96,7 @@ def test_chatbot(self):
9696
data1 = np.random.rand(2, 12).astype(np.float32)
9797
data2 = np.random.rand(2, 12).astype(np.float32)
9898
expected = keras_model.predict([data1, data2])
99-
onnx_model = mock_keras2onnx.convert_keras(keras_model, keras_model.name)
99+
onnx_model = mock_keras2onnx.convert_keras(keras_model, keras_model.name, target_opset=get_max_opset_supported_for_test())
100100
self.assertTrue(
101101
run_keras_and_ort(onnx_model.graph.name, onnx_model, keras_model, [data1, data2], expected, self.model_files))
102102

tests/keras2onnx_unit_tests/test_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ def run_image(model, model_files, img_path, model_name='onnx_conversion', rtol=1
299299
except RuntimeError:
300300
msg = 'keras prediction throws an exception for model ' + model.name + ', skip comparison.'
301301

302-
onnx_model = mock_keras2onnx.convert_keras(model, model.name)
302+
onnx_model = mock_keras2onnx.convert_keras(model, model.name, target_opset=get_max_opset_supported_for_test())
303303
res = run_onnx_runtime(model_name, onnx_model, x, preds, model_files, rtol=rtol, atol=atol, compare_perf=compare_perf)
304304
return res, msg
305305

0 commit comments

Comments
 (0)