@@ -7,7 +7,7 @@ https://github.com/PINTO0309/simple-onnx-processing-tools
7
7
8
8
# Key concept
9
9
- [x] If INPUT OP name and OUTPUT OP name are specified, the onnx graph within the range of the specified OP name is extracted and .onnx is generated.
10
- - [x] Change backend to ` onnx.utils.Extractor .extract_model ` so that onnx.ModelProto can be specified as input .
10
+ - [x] I do not use ` onnx.utils.extractor .extract_model ` because it is very slow and I implement my own model separation logic .
11
11
12
12
## 1. Setup
13
13
### 1-1. HostPC
@@ -18,6 +18,7 @@ $ echo export PATH="~/.local/bin:$PATH" >> ~/.bashrc \
18
18
19
19
# ## run
20
20
$ pip install -U onnx \
21
+ && python3 -m pip install -U onnx_graphsurgeon --index-url https://pypi.ngc.nvidia.com
21
22
&& pip install -U sne4onnx
22
23
```
23
24
### 1-2. Docker
@@ -37,18 +38,18 @@ usage:
37
38
38
39
optional arguments:
39
40
-h, --help
40
- show this help message and exit
41
+ show this help message and exit.
41
42
42
43
--input_onnx_file_path INPUT_ONNX_FILE_PATH
43
44
Input onnx file path.
44
45
45
46
--input_op_names INPUT_OP_NAMES
46
47
List of OP names to specify for the input layer of the model.
47
- e.g. --input_op_names aaa bbb ccc
48
+ e.g. --input_op_names aaa bbb ccc
48
49
49
50
--output_op_names OUTPUT_OP_NAMES
50
51
List of OP names to specify for the output layer of the model.
51
- e.g. --output_op_names ddd eee fff
52
+ e.g. --output_op_names ddd eee fff
52
53
53
54
--output_onnx_file_path OUTPUT_ONNX_FILE_PATH
54
55
Output onnx file path. If not specified, extracted.onnx is output.
@@ -124,8 +125,8 @@ $ sne4onnx \
124
125
from sne4onnx import extraction
125
126
126
127
extracted_graph = extraction(
127
- input_op_names = [' aaa' , ' bbb' , ' ccc' ],
128
- output_op_names = [' ddd' , ' eee' , ' fff' ],
128
+ input_op_names = [' aaa' ,' bbb' ,' ccc' ],
129
+ output_op_names = [' ddd' ,' eee' ,' fff' ],
129
130
input_onnx_file_path = ' input.onnx' ,
130
131
output_onnx_file_path = ' output.onnx' ,
131
132
)
@@ -135,8 +136,8 @@ extracted_graph = extraction(
135
136
from sne4onnx import extraction
136
137
137
138
extracted_graph = extraction(
138
- input_op_names = [' aaa' , ' bbb' , ' ccc' ],
139
- output_op_names = [' ddd' , ' eee' , ' fff' ],
139
+ input_op_names = [' aaa' ,' bbb' ,' ccc' ],
140
+ output_op_names = [' ddd' ,' eee' ,' fff' ],
140
141
onnx_graph = graph,
141
142
output_onnx_file_path = ' output.onnx' ,
142
143
)
0 commit comments