python -m onnxsim 报错:RuntimeException: [ONNXRuntimeError] : 6 : RUNTIME_EXCEPTION ,UpsampleMode) const scale >= 1 was false. Scale value should be greater than or equal to 1.


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.


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM