You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+19-7Lines changed: 19 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,17 +45,30 @@ python setup.py sdist
45
45
```
46
46
47
47
# Usage
48
+
49
+
To convert a TensorFlow model, tf2onnx expects a ```frozen TensorFlow graph``` and the user needs to specify inputs and outputs for the graph by passing the input and output
50
+
names with ```--inputs INPUTS``` and ```--outputs OUTPUTS```.
For example, run following commands in tensorflow-onnx root directory:
63
+
64
+
Parameters:
65
+
- input: frozen TensorFlow graph, which can be got with [freeze graph tool](#freeze_graph).
66
+
- output: the target onnx file path.
67
+
- inputs/outputs: Tensorflow graph's input/output names, which can be got with [summarize graph tool](#summarize_graph).
68
+
- target: There are different onnx versions and workarounds for runtimes that can be set with ```--target TARGET```. The default is onnx-1.1 and caffe2 which generates a graph
69
+
that can be executed on a onnx-1.0/onnx-1.1 runtime, like caffe2 and winml.
70
+
71
+
Usage example (run following commands in tensorflow-onnx root directory):
59
72
```
60
73
python -m tf2onnx.convert\
61
74
--input tests/models/fc-layers/frozen.pb\
@@ -65,12 +78,13 @@ python -m tf2onnx.convert\
65
78
--verbose
66
79
```
67
80
68
-
To convert a TensorFlow model, tf2onnx expects a ```frozen TensorFlow graph``` and the user needs to specify inputs and outputs for the graph by passing the input and output
69
-
names with ```--inputs INPUTS``` and ```--outputs OUTPUTS```.
81
+
## <aname="summarize_graph"></a>Tool to Get Graph Inputs & Outputs
82
+
70
83
To find the inputs and outputs for the TensorFlow graph the model developer will know or you can consult TensorFlow's [summarize_graph](https://github.com/tensorflow/tensorflow/tree/master/tensorflow/tools/graph_transforms) tool, for example:
There are different onnx versions and workarounds for runtimes that can be set with ```--target TARGET```. The default is onnx-1.1 and caffe2 which generates a graph
89
-
that can be executed on a onnx-1.0/onnx-1.1 runtime, like caffe2 and winml.
0 commit comments