1
+ name : Keras2onnx Application Tests (CI)
2
+
3
+ on :
4
+ pull_request :
5
+ branches :
6
+ - main
7
+ push :
8
+ branches :
9
+ - main
10
+ workflow_dispatch :
11
+
12
+ jobs :
13
+ run_tests :
14
+ strategy :
15
+ matrix :
16
+ tf_version : ['2.9.0', '2.13.0']
17
+ python_version : ['3.8', '3.9']
18
+ opset_version : ['18', '15']
19
+ ort_version : ['1.16.3']
20
+ onnx_version : ['1.15.0']
21
+ os : ['ubuntu-latest', 'windows-2022']
22
+
23
+ runs-on : ${{ matrix.os }}
24
+
25
+ steps :
26
+ - name : Set up Python (${{ matrix.python_version }})
27
+ uses : actions/setup-python@v5
28
+ with :
29
+ python-version : ${{ matrix.python_version }}
30
+
31
+ - name : Checkout code
32
+ uses : actions/checkout@v4
33
+
34
+ - name : Install dependencies (TF-v${{ matrix.tf_version }})
35
+ shell : bash
36
+ run : |
37
+ python -m pip install --upgrade pip
38
+ pip install onnxconverter-common
39
+ pip install onnx==${{ matrix.onnx_version }}
40
+ pip uninstall -y protobuf
41
+ pip install "protobuf~=3.20"
42
+ pip install h5py==3.7.0
43
+ pip install parameterized
44
+ pip install timeout-decorator
45
+ pip install coloredlogs flatbuffers
46
+ pip install tensorflow==${{ matrix.tf_version }}
47
+ pip install onnxruntime==${{ matrix.ort_version }}
48
+ pip install Pillow==8.2.0
49
+ pip install opencv-python
50
+ pip install tqdm
51
+ pip install keras-segmentation==0.2.0
52
+ git clone https://github.com/matterport/Mask_RCNN
53
+ cd Mask_RCNN
54
+ pip install -r requirements.txt
55
+ python setup.py install
56
+ cd ..
57
+ pip install matplotlib
58
+ git clone https://github.com/qqwweee/keras-yolo3
59
+ pip install keras-resnet
60
+ pip install git+https://www.github.com/keras-team/keras-contrib.git
61
+ pip install keras-tcn==2.8.3
62
+ pip install git+https://github.com/qubvel/efficientnet
63
+ pip install transformers==4.2.0
64
+ pip install keras-self-attention
65
+ pip install pytest pytest-cov pytest-runner
66
+
67
+ pip install -e .
68
+
69
+ echo "----- List all of depdencies:"
70
+ pip freeze --all
71
+
72
+ - name : Run keras application tests (${{ matrix.os }})
73
+ run : |
74
+ python -c "import onnxruntime"
75
+ pytest tests/keras2onnx_unit_tests --doctest-modules --junitxml=junit/test-results.xml
76
+ cd tests/keras2onnx_applications/nightly_build
77
+ python run_all_v2.py
78
+
79
+ - name : Upload Test Results
80
+ if : always()
81
+ uses : actions/upload-artifact@v3
82
+ with :
83
+ name : Test Results (${{ matrix.tf_version }}-${{ matrix.python_version }}-${{ matrix.os }})
84
+ path : ./**/test-results*.xml
85
+
86
+ run_tests_tf_15 :
87
+ strategy :
88
+ matrix :
89
+ tf_version : ['1.15.0']
90
+ python_version : ['3.7'] # Max version that supports tf 1.15
91
+ opset_version : ['18', '15']
92
+ ort_version : ['1.14.1'] # Max version that supports python 3.7
93
+ onnx_version : ['1.14.1'] # Max version that supports python 3.7
94
+ os : ['ubuntu-latest', 'windows-2022']
95
+
96
+ runs-on : ${{ matrix.os }}
97
+
98
+ steps :
99
+ - name : Set up Python (${{ matrix.python_version }})
100
+ uses : actions/setup-python@v5
101
+ with :
102
+ python-version : ${{ matrix.python_version }}
103
+
104
+ - name : Checkout code
105
+ uses : actions/checkout@v4
106
+
107
+ - name : Install dependencies (TF-v${{ matrix.tf_version }})
108
+ shell : bash
109
+ run : |
110
+ python -m pip install --upgrade pip
111
+ pip install onnxconverter-common
112
+ pip install onnx==${{ matrix.onnx_version }}
113
+ pip uninstall -y protobuf
114
+ pip install "protobuf~=3.20"
115
+ pip install h5py==3.7.0
116
+ pip install parameterized
117
+ pip install timeout-decorator
118
+ pip install coloredlogs flatbuffers
119
+ pip install tensorflow==${{ matrix.tf_version }}
120
+ pip install keras==2.3.1
121
+ pip install onnxruntime==${{ matrix.ort_version }}
122
+ pip install Pillow==8.2.0
123
+ pip install opencv-python
124
+ pip install tqdm
125
+ pip install keras-segmentation==0.2.0
126
+ git clone https://github.com/matterport/Mask_RCNN
127
+ cd Mask_RCNN
128
+ pip install -r requirements.txt
129
+ python setup.py install
130
+ cd ..
131
+ pip install matplotlib
132
+ git clone https://github.com/qqwweee/keras-yolo3
133
+ pip install keras-resnet
134
+ pip install git+https://www.github.com/keras-team/keras-contrib.git
135
+ pip install keras-tcn==2.8.3
136
+ pip install git+https://github.com/qubvel/efficientnet
137
+ pip install transformers==4.2.0
138
+ pip install keras-self-attention
139
+ pip install pytest pytest-cov pytest-runner
140
+ pip install numpy==1.19.0
141
+ pip install h5py==2.9.0
142
+
143
+ pip install -e .
144
+
145
+ echo "----- List all of depdencies:"
146
+ pip freeze --all
147
+
148
+ - name : Run keras application tests (${{ matrix.os }})
149
+ run : |
150
+ python -c "import onnxruntime"
151
+ pytest tests/keras2onnx_unit_tests --doctest-modules --junitxml=junit/test-results.xml
152
+ cd tests/keras2onnx_applications/nightly_build
153
+ python run_all_v2.py --exclude "test_keras_applications_v2.py"
154
+
155
+ - name : Upload Test Results
156
+ if : always()
157
+ uses : actions/upload-artifact@v3
158
+ with :
159
+ name : Test Results (${{ matrix.tf_version }}-${{ matrix.python_version }}-${{ matrix.os }})
160
+ path : ./**/test-results*.xml
161
+
162
+ publish-test-results :
163
+ name : " Publish Tests Results to Github"
164
+ needs : run_tests
165
+ runs-on : ubuntu-latest
166
+ permissions :
167
+ checks : write
168
+ pull-requests : write
169
+ if : always()
170
+ steps :
171
+ - name : Download Artifacts
172
+ uses : actions/download-artifact@v3
173
+ with :
174
+ path : artifacts
175
+
176
+ - name : Publish Test Results
177
+ uses : EnricoMi/publish-unit-test-result-action@v2
178
+ with :
179
+ files : " artifacts/**/*.xml"
180
+
181
+ publish-test-results-tf-15 :
182
+ name : " Publish Tests Results(TF15) to Github"
183
+ needs : run_tests_tf_15
184
+ runs-on : ubuntu-latest
185
+ permissions :
186
+ checks : write
187
+ pull-requests : write
188
+ if : always()
189
+ steps :
190
+ - name : Download Artifacts
191
+ uses : actions/download-artifact@v3
192
+ with :
193
+ path : artifacts
194
+
195
+ - name : Publish Test Results
196
+ uses : EnricoMi/publish-unit-test-result-action@v2
197
+ with :
198
+ files : " artifacts/**/*.xml"
0 commit comments