Skip to content

Commit

Permalink
Add onnxsim before measure (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
andreysher authored Sep 5, 2023
1 parent 5958fbd commit ba1d3b4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions measure.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import onnx
import torch
from enot_latency_server.client import measure_latency_remote
from onnxsim import simplify

from prune import measure_latency_on_server

Expand All @@ -26,6 +27,7 @@

if args.onnx:
onnx_model = onnx.load(args.onnx)
onnx_model, _ = simplify(onnx_model)
latency = measure_latency_remote(onnx_model.SerializeToString(), host=args.host, port=args.port)
print(latency)
exit()
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ enot-autodl==3.3.2
enot-latency-server==1.2.0
imagesize
onnxruntime-gpu
onnxsim
opencv-python
pathspec
scikit-learn
Expand Down

0 comments on commit ba1d3b4

Please sign in to comment.