Open luchangli03 opened 1 year ago
I have the same prob. Can anyone fix it?
When onnx serialises the model into a string, it uses protobuf, which, if the version is high, will make the serialised string wrong, and Onnx can't import it
pip install protobuf==3.20.3
Describe the bug failed when the model size is larger than 2GB
[libprotobuf ERROR /project/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/message_lite.cc:449] onnx.ModelProto exceeded maximum protobuf size of 2GB: 3438405053 Traceback (most recent call last): File "convert_init_to_half.py", line 23, in
onnx_model, check = simplify(onnx_model)
File "/root/.local/lib/python3.8/site-packages/onnxsim/onnx_simplifier.py", line 194, in simplify
check_ok = model_checking.compare(
File "/root/.local/lib/python3.8/site-packages/onnxsim/model_checking.py", line 158, in compare
onnx.checker.check_model(model_opt)
File "/root/miniconda3/envs/tf2/lib/python3.8/site-packages/onnx/checker.py", line 119, in check_model
C.check_model(protobuf_string, full_check)
onnx.onnx_cpp2py_export.checker.ValidationError: The model does not have an ir_version set properly.