File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 14
14
15
15
import tensorflow as tf
16
16
17
- from tf2onnx . graph import GraphUtil
17
+ from tf2onnx import optimizer
18
18
from tf2onnx .tfonnx import process_tf_graph , tf_optimize
19
19
from tf2onnx import constants , loader , logging , utils
20
20
@@ -145,10 +145,10 @@ def main():
145
145
output_names = outputs ,
146
146
inputs_as_nchw = args .inputs_as_nchw )
147
147
148
- model_proto = g . make_model ( "converted from {}" . format ( model_path ) )
149
-
150
- logger . info ( "" )
151
- model_proto = GraphUtil . optimize_model_proto ( model_proto )
148
+ onnx_graph = optimizer . optimize_graph ( g )
149
+ if not onnx_graph :
150
+ onnx_graph = g
151
+ model_proto = onnx_graph . make_model ( "converted from {}" . format ( model_path ) )
152
152
153
153
# write onnx graph
154
154
logger .info ("" )
You can’t perform that action at this time.
0 commit comments