# "Protobuf parsing failed" when onnxruntime opens a quantized model

**URL:** <https://discuss.huggingface.co/t/protobuf-parsing-failed-when-onnxruntime-opens-a-quantized-model/78689>\
**Category:** 🤗Optimum\
**Created:** [March 25, 2024, 7:32pm UTC](https://discuss.huggingface.co/t/protobuf-parsing-failed-when-onnxruntime-opens-a-quantized-model/78689 "2024-03-25T19:32:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![idruker](https://avatars.discourse-cdn.com/v4/letter/i/3bc359/32.png) [@idruker](https://discuss.huggingface.co/u/idruker)\
**Post date:** [March 25, 2024, 7:32pm UTC](https://discuss.huggingface.co/t/protobuf-parsing-failed-when-onnxruntime-opens-a-quantized-model/78689/1 "2024-03-25T19:32:43Z")

</div>

Hello

I used optimum 1.18 to create a quantized onnx model:

```auto
optimum-cli onnxruntime quantize --avx2 --onnx_model model.onnx --output quantized_model.onnx

```

Then I tried to open quantized\_model.onnx with C++ API onnxruntime-1.17.1 shared library but it was rejected due to “Protobuf parsing failed”.

Notes. 1) the same onnxruntime binary is able to open and load non-quantized model.onnx. 2) the quantized model can be opened with Netron.

Anyone has an idea what I am missing?  
Thank you
