Skip to content

Commit

Permalink
Fix onnxruntime load error for newest onnxruntime
Browse files Browse the repository at this point in the history
  • Loading branch information
triple-Mu authored and ericmintun committed Apr 12, 2023
1 parent dec4c12 commit 6abd032
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scripts/export_onnx_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.")

Expand Down

0 comments on commit 6abd032

Please sign in to comment.