OpenPPL / ppq

PPL Quantization Tool (PPQ) is a powerful offline neural network quantization tool.
Apache License 2.0
1.56k stars 236 forks source link

使用ONNXRUNTIME导出之后,推理报错INVALID_GRAPH #583

Closed nostalgiaa-a closed 1 week ago

nostalgiaa-a commented 1 week ago

请问模型量化之后,onnxruntime推理报错是什么原因? onnxruntime.capi.onnxruntime_pybind11_state.InvalidGraph: [ONNXRuntimeError] : 10 : INVALID_GRAPH : Load model from ./model_opset11.onnx failed:This is an invalid model. In Node, ("/Reshape", Reshape, "", -1) : ("onnx::Reshape_0": tensor(float),"/Constant_output_0": tensor(int64),) -> ("/Reshape_output_0": tensor(float),) , Error Unrecognized attribute: allowzero for operator Reshape 之前看到有的issue说降opset版本到13,我降了以后还是有问题,怎么解决?

nostalgiaa-a commented 1 week ago

已解决,opset版本问题,onnx1.17和opset21可以正常推理