KaleiNeely commited on
Commit
f345d42
·
1 Parent(s): 1dddb89

chore(tools): upgrade onnxsim to v0.4.1 (#1441)

Browse files
Files changed (2) hide show
  1. requirements.txt +1 -1
  2. tools/export_onnx.py +2 -7
requirements.txt CHANGED
@@ -15,4 +15,4 @@ psutil
15
  pycocotools>=2.0.2
16
  onnx==1.8.1
17
  onnxruntime==1.8.0
18
- onnx-simplifier==0.3.5
 
15
  pycocotools>=2.0.2
16
  onnx==1.8.1
17
  onnxruntime==1.8.0
18
+ onnx-simplifier==0.4.1
tools/export_onnx.py CHANGED
@@ -102,16 +102,11 @@ def main():
102
 
103
  if not args.no_onnxsim:
104
  import onnx
105
-
106
  from onnxsim import simplify
107
 
108
- input_shapes = {args.input: list(dummy_input.shape)} if args.dynamic else None
109
-
110
- # use onnxsimplify to reduce reduent model.
111
  onnx_model = onnx.load(args.output_name)
112
- model_simp, check = simplify(onnx_model,
113
- dynamic_input_shape=args.dynamic,
114
- input_shapes=input_shapes)
115
  assert check, "Simplified ONNX model could not be validated"
116
  onnx.save(model_simp, args.output_name)
117
  logger.info("generated simplified onnx model named {}".format(args.output_name))
 
102
 
103
  if not args.no_onnxsim:
104
  import onnx
 
105
  from onnxsim import simplify
106
 
107
+ # use onnx-simplifier to reduce reduent model.
 
 
108
  onnx_model = onnx.load(args.output_name)
109
+ model_simp, check = simplify(onnx_model)
 
 
110
  assert check, "Simplified ONNX model could not be validated"
111
  onnx.save(model_simp, args.output_name)
112
  logger.info("generated simplified onnx model named {}".format(args.output_name))