From fcf6d324caf7d78066aa897d647d0e145847dba5 Mon Sep 17 00:00:00 2001 From: Thiago Crepaldi Date: Thu, 21 Sep 2023 15:52:53 +0000 Subject: [PATCH 1/2] Update InferenceSession call to latest format --- .github/workflows/tests.yml | 2 +- test/test_onnx.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 22b20e37c42..22e1a4ac18d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -124,7 +124,7 @@ jobs: conda activate ci echo '::group::Install ONNX' - pip install --progress-bar=off onnx onnxruntime!=1.16.0 + pip install --progress-bar=off onnx onnxruntime echo '::endgroup::' echo '::group::Install testing utilities' diff --git a/test/test_onnx.py b/test/test_onnx.py index 19ed13b1a6d..dd16d776e92 100644 --- a/test/test_onnx.py +++ b/test/test_onnx.py @@ -79,7 +79,8 @@ def to_numpy(tensor): inputs = list(map(to_numpy, inputs)) outputs = list(map(to_numpy, outputs)) - ort_session = onnxruntime.InferenceSession(onnx_io.getvalue()) + ort_session = onnxruntime.InferenceSession(onnx_io.getvalue(), + providers=onnxruntime.get_available_providers()) # compute onnxruntime output prediction ort_inputs = {ort_session.get_inputs()[i].name: inpt for i, inpt in enumerate(inputs)} ort_outs = ort_session.run(None, ort_inputs) From db0772551c39b491e7f79aa6ffcfc61086d8c1f7 Mon Sep 17 00:00:00 2001 From: Philip Meier Date: Fri, 22 Sep 2023 15:58:38 +0200 Subject: [PATCH 2/2] Update test/test_onnx.py --- test/test_onnx.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/test_onnx.py b/test/test_onnx.py index dd16d776e92..0350c817ff8 100644 --- a/test/test_onnx.py +++ b/test/test_onnx.py @@ -79,8 +79,7 @@ def to_numpy(tensor): inputs = list(map(to_numpy, inputs)) outputs = list(map(to_numpy, outputs)) - ort_session = onnxruntime.InferenceSession(onnx_io.getvalue(), - providers=onnxruntime.get_available_providers()) + ort_session = onnxruntime.InferenceSession(onnx_io.getvalue(), providers=onnxruntime.get_available_providers()) # compute onnxruntime output prediction ort_inputs = {ort_session.get_inputs()[i].name: inpt for i, inpt in enumerate(inputs)} ort_outs = ort_session.run(None, ort_inputs)