Skip to content

Commit 16d5a5f

Browse files
authored
chore(tools): upgrade onnxsim to v0.4.1 (Megvii-BaseDetection#1441)
chore(tools): upgrade onnxsim to v0.4.1
1 parent 33f48a9 commit 16d5a5f

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ psutil
1515
pycocotools>=2.0.2
1616
onnx==1.8.1
1717
onnxruntime==1.8.0
18-
onnx-simplifier==0.3.5
18+
onnx-simplifier==0.4.1

tools/export_onnx.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,16 +102,11 @@ def main():
102102

103103
if not args.no_onnxsim:
104104
import onnx
105-
106105
from onnxsim import simplify
107106

108-
input_shapes = {args.input: list(dummy_input.shape)} if args.dynamic else None
109-
110-
# use onnxsimplify to reduce reduent model.
107+
# use onnx-simplifier to reduce reduent model.
111108
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)
109+
model_simp, check = simplify(onnx_model)
115110
assert check, "Simplified ONNX model could not be validated"
116111
onnx.save(model_simp, args.output_name)
117112
logger.info("generated simplified onnx model named {}".format(args.output_name))

0 commit comments

Comments
 (0)