From 6abd03257a59593c7e60ee95fa135df91fc8f026 Mon Sep 17 00:00:00 2001 From: triple-Mu Date: Thu, 6 Apr 2023 09:20:31 +0800 Subject: [PATCH] Fix onnxruntime load error for newest onnxruntime --- scripts/export_onnx_model.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/export_onnx_model.py b/scripts/export_onnx_model.py index a109722..8441258 100644 --- a/scripts/export_onnx_model.py +++ b/scripts/export_onnx_model.py @@ -160,7 +160,9 @@ def run_export( if onnxruntime_exists: ort_inputs = {k: to_numpy(v) for k, v in dummy_inputs.items()} - ort_session = onnxruntime.InferenceSession(output) + # set cpu provider default + providers = ['CPUExecutionProvider'] + ort_session = onnxruntime.InferenceSession(output, providers=providers) _ = ort_session.run(None, ort_inputs) print("Model has successfully been run with ONNXRuntime.")