Skip to content

Commit 12c52e7

Browse files
authored
Fix ImageScaler bias for opset 10 (#322) (#325)
1 parent b2b650f commit 12c52e7

File tree

4 files changed

+18
-4
lines changed

4 files changed

+18
-4
lines changed

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,15 @@
77

88
# Introduction
99
ONNXMLTools enables you to convert models from different machine learning toolkits into [ONNX](https://onnx.ai). Currently the following toolkits are supported:
10+
* Keras (a wrapper of [keras2onnx converter](https://github.com/onnx/keras-onnx/))
11+
* Tensorflow (a wrapper of [tf2onnx converter](https://github.com/onnx/tensorflow-onnx/))
12+
* scikit-learn (a wrapper of [skl2onnx converter](https://github.com/onnx/sklearn-onnx/))
1013
* Apple Core ML
11-
* scikit-learn (subset of models convertible to ONNX)
12-
* Keras
1314
* Spark ML (experimental)
1415
* LightGBM
1516
* libsvm
1617
* XGBoost
1718

18-
To convert Tensorflow models to ONNX, see [tensorflow-onnx](https://github.com/onnx/tensorflow-onnx).
19-
2019
## Install
2120
You can install latest release of ONNXMLTools from [PyPi](https://pypi.org/project/onnxmltools/):
2221
```

onnxmltools/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
from .convert import convert_lightgbm
2323
from .convert import convert_sklearn
2424
from .convert import convert_sparkml
25+
from .convert import convert_tensorflow
2526
from .convert import convert_xgboost
2627

2728
from .utils import load_model

onnxmltools/convert/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@
1010
from .main import convert_lightgbm
1111
from .main import convert_sklearn
1212
from .main import convert_sparkml
13+
from .main import convert_tensorflow
1314
from .main import convert_xgboost

onnxmltools/convert/main.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,19 @@ def convert_sparkml(model, name=None, initial_types=None, doc_string='', target_
7474
return convert(model, name, initial_types, doc_string, target_opset, targeted_onnx,
7575
custom_conversion_functions, custom_shape_calculators, spark_session)
7676

77+
def convert_tensorflow(frozen_graph_def,
78+
name=None, input_names=None, output_names=None,
79+
doc_string='',
80+
target_opset=None,
81+
channel_first_inputs=None,
82+
debug_mode=False, custom_op_conversions=None):
83+
if not utils.keras2onnx_installed():
84+
raise RuntimeError('keras2onnx is not installed. Please install it to use this feature.')
85+
86+
from keras2onnx import convert_tensorflow as convert
87+
return convert(frozen_graph_def, name, input_names, output_names, doc_string,
88+
target_opset, channel_first_inputs, debug_mode, custom_op_conversions)
89+
7790
def convert_xgboost(*args, **kwargs):
7891
if not utils.xgboost_installed():
7992
raise RuntimeError('xgboost is not installed. Please install xgboost to use this feature.')

0 commit comments

Comments
 (0)