首页 > 编程语言> > python -m onnxsim 报错:RuntimeException: [ONNXRuntimeError] : 6 : RUNTIME_EXCEPTION ,UpsampleMode) con
python -m onnxsim 报错:RuntimeException: [ONNXRuntimeError] : 6 : RUNTIME_EXCEPTION ,UpsampleMode) con
作者:互联网
RuntimeException: [ONNXRuntimeError] : 6 : RUNTIME_EXCEPTION : Exception during initialization: /Users/runner/work/1/s/onnxruntime/core/providers/cpu/tensor/upsample.h:271 void onnxruntime::UpsampleBase::ScalesValidation(const std::vector<float> &, const onnxruntime::UpsampleMode) const scale >= 1 was false. Scale value should be greater than or equal to 1.
原因是在
torch.onnx.export 的时候没有配置opset_version参数,默认是9,如果pytorch >=1.3.0,可以配置成11,否则配置成10
详细见:
https://github.com/microsoft/onnxruntime/issues/5548
#=======
@hariharans29 Thank you for your reply, I re-generated the onnx file. The above mentioned problem happens with opset=9, but when setting opset=10, everything goes on well as expected.
标签:EXCEPTION,scale,const,onnxruntime,opset,Scale,报错,false 来源: https://www.cnblogs.com/YouXiangLiThon/p/14412521.html