从ONNX运行超级分辨率模型时出错

问题描述

正在测试super resolution model的ONNX模型,运行this sample program时出错。

我的ONNX版本是1.5.0,带有onnxruntime 1.4.0。 Onnxruntime was installed using pip。 Pytorch版本是1.6.0

错误发生在ort_session = onnxruntime.InferenceSession('/home/itc/pytorch/sub_pixel_cnn_2016/model/super-resolution-10.onnx')

错误在于加载onnx模型。

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.
 

如何解决该错误?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)