onnx / models

A collection of pre-trained, state-of-the-art models in the ONNX format
http://onnx.ai/models/
Apache License 2.0
7.48k stars 1.36k forks source link

Error on running Super Resolution Model from ONNX #385

Open nyanmn opened 3 years ago

nyanmn commented 3 years ago

Testing ONNX model for super resolution model, I have error running this sample program.

My ONNX version is 1.5.0 with onnxruntime 1.4.0. Onnxruntime was installed using pip. Pytorch version is 1.6.0

Error is at

ort_session = onnxruntime.InferenceSession('/home/itc/pytorch/sub_pixel_cnn_2016/model/super-resolution-10.onnx')

The error is in loading onnx model.

Traceback (most recent call last):
  File "test.py", line 73, in <module>
    ort_session = onnxruntime.InferenceSession('/home/itc/pytorch/sub_pixel_cnn_2016/model/super-resolution-10.onnx')
  File "/home/itc/pytorch/lib/python3.7/site-packages/onnxruntime/capi/session.py", line 158, in __init__
    self._load_model(providers or [])
  File "/home/itc/pytorch/lib/python3.7/site-packages/onnxruntime/capi/session.py", line 166, in _load_model
    True)
RuntimeError: /onnxruntime_src/onnxruntime/core/session/inference_session.cc:238 onnxruntime::InferenceSession::InferenceSession(const onnxruntime::SessionOptions&, const onnxruntime::Environment&, const string&) status.IsOK() was false. Given model could not be parsed while creating inference session. Error message: Protobuf parsing failed.

How can I solve the error?

kit1980 commented 3 years ago

Link to the StackOverflow question (duplicate of this issue) - https://stackoverflow.com/questions/64273951/error-on-running-super-resolution-model-from-onnx

kit1980 commented 3 years ago

I believe this question was resolved on StackOverflow and this issue can be now closed.

Yangly0 commented 3 years ago

I get the same problem. I found the download model file sdd-10.onnx is 113 KB instead of 80.4 MB, so you should download the model file again.