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