Skip to content

Commit 03c8f52

Browse files
authored
Update README.md
1 parent 563b0f7 commit 03c8f52

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

README.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -73,17 +73,16 @@ python -m tf2onnx.convert
7373
--graphdef SOURCE_GRAPHDEF_PB
7474
--checkpoint SOURCE_CHECKPOINT
7575
--saved-model SOURCE_SAVED_MODEL
76+
[--output TARGET_ONNX_MODEL]
7677
[--inputs GRAPH_INPUTS]
7778
[--outputs GRAPH_OUTPUS]
7879
[--inputs-as-nchw inputs_provided_as_nchw]
80+
[--opset OPSET]
7981
[--target TARGET]
80-
[--output TARGET_ONNX_GRAPH]
81-
[--target TARGET]
82-
[--continue_on_error]
83-
[--verbose]
8482
[--custom-ops list-of-custom-ops]
85-
[--opset OPSET]
8683
[--fold_const]
84+
[--continue_on_error]
85+
[--verbose]
8786
```
8887

8988
## Parameters
@@ -100,10 +99,10 @@ the target onnx file path.
10099
Tensorflow model's input/output names, which can be found with [summarize graph tool](#summarize_graph). Those names typically end on ```:0```, for example ```--inputs input0:0,input1:0```. inputs and outputs are ***not*** needed for models in saved-model format.
101100
### --inputs-as-nchw
102101
By default we preserve the image format of inputs (nchw or nhwc) as given in the TensorFlow model. If your hosts (for example windows) native format nchw and the model is written for nhwc, ```--inputs-as-nchw``` tensorflow-onnx will transpose the input. Doing so is convinient for the application and the converter in many cases can optimize the transpose away. For example ```--inputs input0:0,input1:0 --inputs-as-nchw input0:0``` assumes that images are passed into ```input0:0``` as nchw while the TensorFlow model given uses nhwc.
103-
### --target
104-
Some runtimes need workarounds, for example they don't support all types given in the onnx spec. We'll workaround it in some cases by generating a different graph. Those workarounds are activated with ```--target TARGET```.
105102
### --opset
106-
by default we uses the newest opset 7 to generate the graph. By specifieing ```--opset``` the user can override the default to generate a graph with the desired opset. For example ```--opset 5``` would create a onnx graph that uses only ops available in opset 5. Because older opsets have in most cases fewer ops, some models might not convert on a older opset.
103+
By default we use the opset 7 to generate the graph. By specifying ```--opset``` the user can override the default to generate a graph with the desired opset. For example ```--opset 5``` would create a onnx graph that uses only ops available in opset 5. Because older opsets have in most cases fewer ops, some models might not convert on a older opset.
104+
### --target
105+
Some models require special handling, for example they don't support all data types. We'll workaround it in some cases by generating a different graph. Those workarounds are activated with ```--target TARGET```. Currently supported values are listed on this [wiki](https://github.com/onnx/tensorflow-onnx/wiki/target). If your model will be run on Windows ML, you should specify the appropriate target value.
107106
### --custom-ops
108107
the runtime may support custom ops that are not defined in onnx. A user can asked the converter to map to custom ops by listing them with the --custom-ops option. Tensorflow ops listed here will be mapped to a custom op with the same name as the tensorflow op but in the onnx domain ai.onnx.converters.tensorflow. For example: ```--custom-ops Print``` will insert a op ```Print``` in the onnx domain ```ai.onnx.converters.tensorflow``` into the graph. We also support a python api for custom ops documented later in this readme.
109108
### --fold_const
@@ -163,7 +162,7 @@ optional arguments:
163162
--config yaml config file
164163
--verbose verbose output, option is additive
165164
--opset OPSET target opset to use
166-
--perf csv-file capture performance numbers or tensorflow and onnx runtime
165+
--perf csv-file capture performance numbers for tensorflow and onnx runtime
167166
--debug dump generated graph with shape info
168167
--fold_const when set, TensorFlow fold_constants transformation will be applied before conversion. This will benefit features including Transpose optimization (e.g. Transpose operations introduced during tf-graph-to-onnx-graph conversion will be removed), and RNN unit conversion (for example LSTM).
169168
```

0 commit comments

Comments
 (0)