Skip to content

Commit

Permalink
Merge branch 'master' into r1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
guschmue committed Jan 2, 2020
2 parents 6e8f348 + 342270f commit 80f85b1
Show file tree
Hide file tree
Showing 42 changed files with 1,609 additions and 289 deletions.
28 changes: 28 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-performance-issue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: Bug/Performance issue
about: Use this template for reporting a bug or a performance issue.

---

**Describe the bug**
A clear and concise description of what the bug is.

**Urgency**
If there are particular important use cases blocked by this or strict project-related timelines, please share more information and dates. If there are no hard deadlines, please specify none.

**System information**
- OS Platform and Distribution (e.g., Linux Ubuntu 16.04):
- Tensorflow Version:
- Python version:

**To Reproduce**
Describe steps/code to reproduce the behavior:

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Additional context**
Add any other context about the problem here. If the issue is about a particular model, please share the model details as well to facilitate debugging.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@ tf2onnx - Convert TensorFlow models to ONNX.

| Build Type | OS | Python | Tensorflow | Onnx opset | Status |
| --- | --- | --- | --- | --- | --- |
| Unit Test - Basic | Linux, MacOS<sup>\*</sup>, Windows<sup>\*</sup> | 3.5, 3.6 | 1.5-1.14 | 7-10 | [![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) |
| Unit Test - Full | Linux, MacOS, Windows | 3.5, 3.6, 3.7 | 1.5-1.14 | 7-10 | [![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) | |
| Unit Test - Basic | Linux, MacOS<sup>\*</sup>, Windows<sup>\*</sup> | 3.5, 3.6 | 1.5-1.14 | 7-11 | [![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) |
| Unit Test - Full | Linux, MacOS, Windows | 3.5, 3.6, 3.7 | 1.5-1.14 | 7-11 | [![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) | |

<a name="build_status_footnote">\*</a> Only test on python3.6, TF1.14.

# Supported ONNX version
tensorflow-onnx will use the ONNX version installed on your system and installs the latest ONNX version if none is found.

We support opset 6 to 10. By default we use opset 7 for the resulting ONNX graph since most runtimes will support opset 7. Support for future opsets add added as they are released.
We support opset 6 to 11. By default we use opset 8 for the resulting ONNX graph since most runtimes will support opset 8.
Support for future opsets add added as they are released.

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

# Status
We support many TensorFlow models. Support for Fully Connected, Convolutional and dynamic LSTM networks is mature.
Expand Down
4 changes: 2 additions & 2 deletions ci_build/azure_pipelines/onnxruntime_nightly_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ stages:
jobs:
- template: 'templates/job_generator.yml'
parameters:
platforms: ['linux', 'windows', 'mac']
platforms: ['linux', 'windows']
python_versions: ['3.6', '3.5']
tf_versions: ['1.13.1','1.12', '1.11', '1.10', '1.9', '1.8', '1.7', '1.6', '1.5']
onnx_opsets: ['']
Expand All @@ -17,7 +17,7 @@ stages:

- template: 'templates/job_generator.yml'
parameters:
platforms: ['linux', 'windows', 'mac']
platforms: ['linux', 'windows']
python_versions: ['3.7', '3.6', '3.5']
tf_versions: ['1.14']
onnx_opsets: ['']
Expand Down
4 changes: 2 additions & 2 deletions ci_build/azure_pipelines/pretrained_model_test-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
jobs:
- template: 'templates/job_generator.yml'
parameters:
platforms: ['linux', 'windows', 'mac']
platforms: ['linux', 'windows']
python_versions: ['3.6', '3.5']
tf_versions: ['1.13.1', '1.12', '1.11', '1.10', '1.9', '1.8', '1.7', '1.6', '1.5']
job:
Expand All @@ -12,7 +12,7 @@ jobs:

- template: 'templates/job_generator.yml'
parameters:
platforms: ['linux', 'windows', 'mac']
platforms: ['linux', 'windows']
python_versions: ['3.7', '3.6', '3.5']
tf_versions: ['1.14']
job:
Expand Down
8 changes: 4 additions & 4 deletions ci_build/azure_pipelines/pretrained_model_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
jobs:
- template: 'templates/job_generator.yml'
parameters:
python_versions: ['3.7', '3.6', '3.5']
tf_versions: ['1.14.0']
python_versions: ['3.7', '3.5']
tf_versions: ['1.14']
job:
steps:
- template: 'pretrained_model_test.yml'

- template: 'templates/job_generator.yml'
parameters:
platforms: ['windows', 'mac']
tf_versions: ['1.14.0']
platforms: ['windows']
tf_versions: ['1.14']
job:
steps:
- template: 'pretrained_model_test.yml'
4 changes: 2 additions & 2 deletions ci_build/azure_pipelines/templates/job_generator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ parameters:
python_versions: ['3.6']
tf_versions: ['']
onnx_versions: ['']
onnx_opsets: ['10', '9', '8', '7']
onnx_backends: {onnxruntime: ['0.4.0']}
onnx_opsets: ['11', '10', '9', '8', '7']
onnx_backends: {onnxruntime: ['1.0.0']}
job: {}
run_setup: 'True'
report_coverage: 'False'
Expand Down
5 changes: 4 additions & 1 deletion ci_build/azure_pipelines/templates/setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,13 @@ steps:
# https://github.com/numpy/numpy/issues/12957
# https://github.com/ContinuumIO/anaconda-issues/issues/10629
# Add numpy lib path manually here
# On Windows sqlite3.dll is found under Library/bin
- bash: |
site_dir=$(python -c "import site; print(site.getsitepackages()[1])")
echo "##vso[task.prependpath]$site_dir\numpy\.libs"
displayName: 'Fix Numpy Path'
base_dir=$(python -c "import site; print(site.getsitepackages()[0])")
echo "##vso[task.prependpath]$base_dir/Library/bin"
displayName: 'Fix Paths'
condition: and(succeeded(), in(variables['Agent.OS'], 'Windows_NT'))

- bash: env
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: ['10', '9', '8', '7']
onnx_opsets: ['11', '10', '9', '8', '7']

steps:
- ${{ each onnx_opset in parameters.onnx_opsets }}:
Expand Down
6 changes: 3 additions & 3 deletions ci_build/azure_pipelines/unit_test-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ stages:
jobs:
- template: 'templates/job_generator.yml'
parameters:
platforms: ['linux', 'windows', 'mac']
platforms: ['linux', 'windows']
python_versions: ['3.6', '3.5']
tf_versions: ['1.13.1','1.12', '1.11', '1.10', '1.9', '1.8', '1.7', '1.6', '1.5']
tf_versions: ['1.13.1', '1.11', '1.10', '1.9', '1.7', '1.5']
onnx_opsets: ['']
job:
steps:
Expand All @@ -16,7 +16,7 @@ stages:

- template: 'templates/job_generator.yml'
parameters:
platforms: ['linux', 'windows', 'mac']
platforms: ['linux', 'windows']
python_versions: ['3.7', '3.6', '3.5']
tf_versions: ['1.14']
onnx_opsets: ['']
Expand Down
4 changes: 2 additions & 2 deletions ci_build/azure_pipelines/unit_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ stages:

- template: 'templates/job_generator.yml'
parameters:
tf_versions: ['1.13.1', '1.12', '1.11', '1.10', '1.9', '1.8', '1.7', '1.6', '1.5']
tf_versions: ['1.14', '1.12', '1.11', '1.10', '1.9', '1.7']
onnx_opsets: ['']
job:
steps:
Expand All @@ -24,7 +24,7 @@ stages:

- template: 'templates/job_generator.yml'
parameters:
platforms: ['windows', 'mac']
platforms: ['windows']
tf_versions: ['1.14']
onnx_opsets: ['']
job:
Expand Down
1 change: 1 addition & 0 deletions support_status.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
| Greater | 1 ~ 10 |
| Less | 1 ~ 10 |
| Add | 1 ~ 10 |
| AddV2 | 1 ~ 10 |
| Div | 1 ~ 10 |
| Mul | 1 ~ 10 |
| Sub | 1 ~ 10 |
Expand Down
2 changes: 1 addition & 1 deletion tests/backend_test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from tf2onnx import optimizer


# pylint: disable=missing-docstring,invalid-name,unused-argument,using-constant-test
# pylint: disable=missing-docstring,invalid-name,unused-argument,using-constant-test, import-outside-toplevel

class Tf2OnnxBackendTestBase(unittest.TestCase):
def setUp(self):
Expand Down
1 change: 1 addition & 0 deletions tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import tensorflow as tf
from tf2onnx import constants, logging, utils

# pylint: disable=import-outside-toplevel
__all__ = [
"TestConfig",
"get_test_config",
Expand Down
2 changes: 1 addition & 1 deletion tests/run_pretrained_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
from tf2onnx import loader, logging, optimizer, utils
from tf2onnx.tfonnx import process_tf_graph

# pylint: disable=broad-except,logging-not-lazy,unused-argument,unnecessary-lambda
# pylint: disable=broad-except,logging-not-lazy,unused-argument,unnecessary-lambda,import-outside-toplevel

logger = logging.getLogger("run_pretrained")

Expand Down
73 changes: 58 additions & 15 deletions tests/run_pretrained_models.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,15 @@ googlenet_v4_slim:
- InceptionV4/Logits/Predictions:0
rtol: 0.1

mobilenet_v3_large_float:
url: https://storage.googleapis.com/mobilenet_v3/checkpoints/v3-large_224_1.0_float.tgz
model: v3-large_224_1.0_float/v3-large_224_1.0_float.pb
input_get: get_beach
inputs:
"input:0": [1, 224, 224, 3]
outputs:
- MobilenetV3/Predictions/Softmax:0

mobilenet_v2_1.4_224:
url: https://storage.googleapis.com/mobilenet_v2/checkpoints/mobilenet_v2_1.4_224.tgz
model: mobilenet_v2_1.4_224_frozen.pb
Expand Down Expand Up @@ -237,7 +246,6 @@ resnet50_v2_nchw: # NOTE: Tensorflow 1.9.0 fails
- ArgMax:0
- softmax_tensor:0


resnet50_v2_nhwc:
model_type: saved_model
url: http://download.tensorflow.org/models/official/20181001_resnet/savedmodels/resnet_v2_fp32_savedmodel_NHWC.tar.gz
Expand All @@ -261,7 +269,6 @@ resnet50_fp16_v2:
- ArgMax:0
- softmax_tensor:0


resnet50_v1:
disabled: true # works, disabled because its nearly the same as resnet50_v2_nchw
skip_tensorflow: true # tensorflow fails: Default MaxPoolingOp only supports NHWC on device type CPU
Expand All @@ -275,19 +282,18 @@ resnet50_v1:
- ArgMax:0
- softmax_tensor:0

#
# models that will never work
#
style-transfer:
# quantitized model
disabled: true
url: https://storage.googleapis.com/download.tensorflow.org/models/stylize_v1.zip
model: stylize_quantized.pb
ssd_mobilenet_v3_large_coco:
url: http://download.tensorflow.org/models/object_detection/ssd_mobilenet_v3_large_coco_2019_08_14.tar.gz
model: ssd_mobilenet_v3_large_coco_2019_08_14/frozen_inference_graph.pb
opset_constraints:
"onnx":
"min": 10
input_get: get_beach
inputs:
"input:0": [1, 416, 416, 3]
"normalized_input_image_tensor:0": [1, 320, 320, 3]
outputs:
- output:0
- raw_outputs/box_encodings:0
- raw_outputs/class_predictions:0

ssd_mobilenet_v1_coco:
url: http://download.tensorflow.org/models/object_detection/ssd_mobilenet_v1_coco_2017_11_17.tar.gz
Expand All @@ -305,10 +311,13 @@ ssd_mobilenet_v1_coco:
- detection_classes:0

ssd_mobilenet_v2_coco:
# issues with control flow
# works with opset-10
disabled: true
url: http://download.tensorflow.org/models/object_detection/ssd_mobilenet_v2_coco_2018_03_29.tar.gz
model: ssd_mobilenet_v2_coco_2018_03_29/frozen_inference_graph.pb
opset_constraints:
"onnx":
"min": 10
input_get: get_beach
inputs:
"image_tensor:0": [1, 224, 224, 3]
Expand All @@ -319,10 +328,13 @@ ssd_mobilenet_v2_coco:
- detection_classes:0

ssdlite_mobilenet_v2_coco:
# issues with control flow
# works with opset-10
disabled: true
url: http://download.tensorflow.org/models/object_detection/ssdlite_mobilenet_v2_coco_2018_05_09.tar.gz
model: ssdlite_mobilenet_v2_coco_2018_05_09/frozen_inference_graph.pb
opset_constraints:
"onnx":
"min": 10
input_get: get_beach
inputs:
"image_tensor:0": [1, 224, 224, 3]
Expand All @@ -333,10 +345,12 @@ ssdlite_mobilenet_v2_coco:
- detection_classes:0

ssd_inception_v2_coco:
# issues with control flow
disabled: true
url: http://download.tensorflow.org/models/object_detection/ssd_inception_v2_coco_2017_11_17.tar.gz
model: ssd_inception_v2_coco_2017_11_17/frozen_inference_graph.pb
opset_constraints:
"onnx":
"min": 10
input_get: get_beach
inputs:
"image_tensor:0": [1, 224, 224, 3]
Expand All @@ -345,3 +359,32 @@ ssd_inception_v2_coco:
- detection_scores:0
- num_detections:0
- detection_classes:0

#
# models that will not work
#
style-transfer:
# quantitized model
disabled: true
url: https://storage.googleapis.com/download.tensorflow.org/models/stylize_v1.zip
model: stylize_quantized.pb
input_get: get_beach
inputs:
"input:0": [1, 416, 416, 3]
outputs:
- output:0

faster_rcnn_inception_v2_coco:
url: http://download.tensorflow.org/models/object_detection/faster_rcnn_inception_v2_coco_2018_01_28.tar.gz
model: faster_rcnn_inception_v2_coco_2018_01_28/frozen_inference_graph.pb
opset_constraints:
"onnx":
"min": 11
input_get: get_beach
inputs:
"image_tensor:0": [1, 224, 224, 3]
outputs:
- detection_boxes:0
- detection_classes:0
- detection_scores:0
- num_detections:0
Loading

0 comments on commit 80f85b1

Please sign in to comment.