deepinsight / insightface

State-of-the-art 2D and 3D Face Analysis Project
https://insightface.ai
22.84k stars 5.35k forks source link

Duplicate node name issue on scrfd (Face Detection) quantization #1722

Open alighofrani95 opened 3 years ago

alighofrani95 commented 3 years ago

I've tried to quantized an scrfd onnx model but was faced with onnxruntime.capi.onnxruntime_pybind11_state.Fail: [ONNXRuntimeError] : 1 : FAIL : Load model from qq.onnx failed:This is an invalid model. Error: two nodes with same node name (neck.fpn_convs.1.conv.bias_scale_node).

tried to rename all duplicated name but it doesn't solve. this problem occurs for all kinds of scrfd models such as 10g, .., 500

System information

nttstar commented 3 years ago

How do you do quantization?

alighofrani95 commented 3 years ago

How do you do quantization?


from onnxruntime.quantization import quantize_dynamic, QuantType
model_input = "scrfd_500m_bnkps.onnx"
model_output = "scrfd_500m_bnkps-q.onnx"
quantize_dynamic(model_input, model_output)
nttstar commented 3 years ago

most probably, ort quantization tool has some bugs.

nttstar commented 3 years ago

https://github.com/microsoft/onnxruntime/issues/7300 similar issue

daigo0927 commented 2 years ago

upvote 👍