Skip to content

Commit 9d7e166

Browse files
committed
fix minor issue, and refine a bit about installation & usage in README
1 parent 88b317f commit 9d7e166

File tree

1 file changed

+28
-13
lines changed

1 file changed

+28
-13
lines changed

README.md

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,42 +12,57 @@ Tf2onnx is in its early development. Mileage will vary since TensorFlow supports
1212
# Status
1313
Basic net and conv nets should work. A list of models that pass tests can be found [here](tests/run_pretrained_models.yaml)
1414

15-
# Installation
15+
# Prerequisites
16+
17+
## Install TensorFlow
1618
If you don't have tensorflow installed already, install the desired tensorflow build, for example:
1719
```
1820
pip install tensorflow
1921
or
2022
pip install tensorflow-gpu
2123
```
22-
24+
## Install Caffe2 [**Optional**]
2325
If you want to run unit tests against the Caffe2 onnx backend, build and install Caffe2 following the instructions here: ```
2426
https://caffe2.ai/```
25-
We tested with tensorflow 1.5,1.6,1.7,1.8 and anaconda 3.5,3.6.
27+
28+
## Python Version
29+
We tested with tensorflow 1.5,1.6,1.7,1.8 and anaconda **3.5,3.6**.
30+
31+
# Installation
2632

2733
Once dependencies are installed, from the tensorflow-onnx folder call:
34+
2835
```
2936
python setup.py install
30-
```
3137
or
32-
```
3338
python setup.py develop
3439
```
40+
tensorflow-onnx requires onnx-1.2.2 or better and will install/upgrade onnx if needed.
3541

3642
To create a distribution:
3743
```
3844
python setup.py sdist
3945
```
4046

41-
tensorflow-onnx requires onnx-1.2.2 or better and will install/upgrade onnx if needed.
42-
4347
# Usage
4448
```
45-
python -m tf2onnx.convert
46-
usage: convert.py [-h] --input INPUT [--output OUTPUT] [--target TARGET] --inputs INPUTS --outputs OUTPUTS [--continue_on_error] [--verbose] [--opset OPSET]
47-
```
48-
For example:
49-
```
50-
python -m tf2onnx.convert --input tests/models/fc-layers/frozen.pb --inputs X:0 --outputs output:0 --output tests/models/fc-layers/model.onnx --pretty --verbose
49+
python -m tf2onnx.convert --input SOURCE_FROZEN_GRAPH_PB\
50+
--inputs SOURCE_GRAPH_INPUTS\
51+
--outputs SOURCE_GRAPH_OUTPUS\
52+
[--output TARGET_ONNX_GRAPH\]
53+
[--target TARGET]\
54+
[--continue_on_error]\
55+
[--verbose]\
56+
[--opset OPSET]
57+
```
58+
For example, run following commands in tensorflow-onnx root directory:
59+
```
60+
python -m tf2onnx.convert\
61+
--input tests/models/fc-layers/frozen.pb\
62+
--inputs X:0\
63+
--outputs output:0\
64+
--output tests/models/fc-layers/model.onnx\
65+
--verbose
5166
```
5267

5368
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

0 commit comments

Comments
 (0)