ZhangGe6 / onnx-modifier

A tool to modify ONNX models in a visualization fashion, based on Netron and Flask.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ValueError: Unsupported format: '<class 'onnx.onnx_ml_pb2.ModelProto'>'. Supported formats are: dict_keys(['protobuf', 'textproto', 'json', 'onnxtxt'])

Egorundel opened this issue · comments

commented

@ZhangGe6 Hello, I have a problem with onnx-modifier. When I want to download edited on model, I have a problem with saving:

ValueError: Unsupported format: '<class 'onnx.onnx_ml_pb2.ModelProto'>'. Supported formats are: dict_keys(['protobuf', 'textproto', 'json', 'onnxtxt'])

and

NameError: name 'onnx_modifier' is not defined

Screenshot from 2023-10-28 14-03-52

Screenshot from 2023-10-28 14-04-03

Can you help me, please?

@Egorundel Thanks for reporting with the detailed error log. It seems like an ONNX format problem. Can you open this model successfully using Netron? If the model can not be opened using Netron either, it is suggested to check your model format or open an issue on the ONNX github repo.

commented

@ZhangGe6 yes, here is my model in Netron:
Screenshot from 2023-10-28 17-16-42

commented

@ZhangGe6 I can upload my model to some service so you can watch it

commented

@ZhangGe6 my model on GoogleDrive: best_ckpt.onnx

commented

The problem was solved quite simply: just downgrade the onnx version. I installed pip install onnx==1.13.0 and everything worked for me without errors.