You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a onnx model converted form tf with tf2onnx tool. when converted from tf, the model is large than 2GB so I have used the --large_model option
when I use onnx_graphsurgeon to get and modifed graph: graph = gs.import_onnx(onnx.load(ori_onnx_path))
I got the following error:
File "onnx_surgery.py", line 72, in onnx_model_surgery
graph = gs.import_onnx(onnx.load(ori_onnx_path))
File "/usr/local/lib/python3.8/dist-packages/onnx/init.py", line 134, in load_model
model = load_model_from_string(s, format=format)
File "/usr/local/lib/python3.8/dist-packages/onnx/init.py", line 171, in load_model_from_string
return _deserialize(s, ModelProto())
File "/usr/local/lib/python3.8/dist-packages/onnx/init.py", line 108, in _deserialize
decoded = cast(Optional[int], proto.ParseFromString(s))
File "/usr/local/lib/python3.8/dist-packages/google/protobuf/message.py", line 202, in ParseFromString
return self.MergeFromString(serialized)
File "/usr/local/lib/python3.8/dist-packages/google/protobuf/internal/python_message.py", line 1128, in MergeFromString
if self._InternalParse(serialized, 0, length) != length:
File "/usr/local/lib/python3.8/dist-packages/google/protobuf/internal/python_message.py", line 1178, in InternalParse
raise message_mod.DecodeError('Field number 0 is illegal.')
google.protobuf.message.DecodeError: Field number 0 is illegal.
And I have found another issued got the similar problem , I have tried the solustion
Description
I have a onnx model converted form tf with tf2onnx tool. when converted from tf, the model is large than 2GB so I have used the --large_model option
when I use onnx_graphsurgeon to get and modifed graph:
graph = gs.import_onnx(onnx.load(ori_onnx_path))
I got the following error:
File "onnx_surgery.py", line 72, in onnx_model_surgery
graph = gs.import_onnx(onnx.load(ori_onnx_path))
File "/usr/local/lib/python3.8/dist-packages/onnx/init.py", line 134, in load_model
model = load_model_from_string(s, format=format)
File "/usr/local/lib/python3.8/dist-packages/onnx/init.py", line 171, in load_model_from_string
return _deserialize(s, ModelProto())
File "/usr/local/lib/python3.8/dist-packages/onnx/init.py", line 108, in _deserialize
decoded = cast(Optional[int], proto.ParseFromString(s))
File "/usr/local/lib/python3.8/dist-packages/google/protobuf/message.py", line 202, in ParseFromString
return self.MergeFromString(serialized)
File "/usr/local/lib/python3.8/dist-packages/google/protobuf/internal/python_message.py", line 1128, in MergeFromString
if self._InternalParse(serialized, 0, length) != length:
File "/usr/local/lib/python3.8/dist-packages/google/protobuf/internal/python_message.py", line 1178, in InternalParse
raise message_mod.DecodeError('Field number 0 is illegal.')
google.protobuf.message.DecodeError: Field number 0 is illegal.
And I have found another issued got the similar problem , I have tried the solustion
but the graph loaded from opt_onnx_path has no nodes and inputs, I have no idea how to edit the grah? Is there any solution for my Scenario?
The text was updated successfully, but these errors were encountered: