inisis / OnnxSlim

A Toolkit to Help Optimize Onnx Model
MIT License
81 stars 10 forks source link

[Question] onnxslim的优化问题 #28

Open mfkhandsome opened 1 month ago

mfkhandsome commented 1 month ago

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

inisis commented 1 month ago

Can you prodive your onnx and onnxruntime version

mfkhandsome commented 1 month 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 1 month 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 1 month 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