ZhangGe6 / onnx-modifier

A tool to modify ONNX models in a visualization fashion, based on Netron and Flask.
MIT License
1.28k stars 157 forks source link

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

Closed Egorundel closed 10 months ago

Egorundel commented 10 months ago

@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?

ZhangGe6 commented 10 months ago

@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.

Egorundel commented 10 months ago

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

Egorundel commented 10 months ago

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

Egorundel commented 10 months ago

@ZhangGe6 my model on GoogleDrive: best_ckpt.onnx

Egorundel commented 10 months ago

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.