inisis / OnnxSlim

A Toolkit to Help Optimize Onnx Model
MIT License
71 stars 8 forks source link

[Question] onnxslim的优化问题 #28

Open mfkhandsome opened 5 days ago

mfkhandsome commented 5 days ago

我在yolov5网络中更改了我的模型,但当我使用onnxslim对我的onnx模型进行onnxslim Our-slim.onnx Our-slim2.onnx这一步的操作时,他并没有将unsqueeze这些给优化掉。 onnxslim

inisis commented 5 days ago

Can you prodive your onnx and onnxruntime version

mfkhandsome commented 5 days ago

Can you prodive your onnx and onnxruntime version

my onnx and onnxruntime version is onnx 1.16.0 and onnxruntme is 1.17.1 onnx

inisis commented 5 days ago

you can check onnx and onnxruntime version compatibility here, https://onnxruntime.ai/docs/reference/compatibility.html

image

for your case, you should downgrade your onnx version to 1.15

mfkhandsome commented 5 days ago

you can check onnx and onnxruntime version compatibility here, https://onnxruntime.ai/docs/reference/compatibility.html

image

for your case, you should downgrade your onnx version to 1.15

This is a viable method. When I switched to ONNX 1.15.0 and later, I was able to use onnxslim to complete the optimization, while onnxsim could not optimize my custom model. Thank you so much; the onnxslim model has been a great help to me. onnx1