daquexian / onnx-simplifier

Simplify your onnx model
Apache License 2.0
3.85k stars 383 forks source link

KeyError: '271' when simplifying SSD based face detection onnx model #3

Closed zxDeepDiver closed 5 years ago

zxDeepDiver commented 5 years ago

Hi,

I am using the onnx-simplifier to process the SSD onnx model. The model is originally from pytorch. I convert it from pytorch to onnx using torch.onnx._export. Then I use python -m onnxsim faceboxes.onnx faceboxes-sim.onnx to simplify the onnx model, and get the following error:

image

The original pytorch code is : https://github.com/zisianw/FaceBoxes.PyTorch The original pytorch model file (save with all information: "torch.save(model,'model_all.pkl')") is uploaded to the BaiduNetDisk. The onnx file converted from pytorch model is also uploaded.

Model file address: 链接:https://pan.baidu.com/s/1HA-ONKXtRrxa6v5cDlL5UQ 提取码:arrs 复制这段内容后打开百度网盘手机App,操作更方便哦

daquexian commented 5 years ago

Thanks for your report. I will manage to solve it when I have time. :)

daquexian commented 5 years ago

Fixed in 502ef40. Please upgrade onnx-simplifier to 0.1.4

daquexian commented 5 years ago

Before: image After: image