From 5a3f2d0157fb111143f9cdeaa355415d5b0210ce Mon Sep 17 00:00:00 2001 From: pinto0309 Date: Wed, 15 Mar 2023 18:04:31 +0900 Subject: [PATCH 1/2] Increased supported data types --- sit4onnx/__init__.py | 2 +- sit4onnx/onnx_inference_test.py | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/sit4onnx/__init__.py b/sit4onnx/__init__.py index 5155e11..959f50e 100644 --- a/sit4onnx/__init__.py +++ b/sit4onnx/__init__.py @@ -1,3 +1,3 @@ from sit4onnx.onnx_inference_test import inference, main -__version__ = '1.0.6' +__version__ = '1.0.7' diff --git a/sit4onnx/onnx_inference_test.py b/sit4onnx/onnx_inference_test.py index 19e1c7c..6999452 100644 --- a/sit4onnx/onnx_inference_test.py +++ b/sit4onnx/onnx_inference_test.py @@ -36,8 +36,15 @@ class Color: ONNX_DTYPES_TO_NUMPY_DTYPES: dict = { + f'{onnx.TensorProto.FLOAT16}': np.float16, f'{onnx.TensorProto.FLOAT}': np.float32, f'{onnx.TensorProto.DOUBLE}': np.float64, + f'{onnx.TensorProto.UINT8}': np.uint8, + f'{onnx.TensorProto.UINT16}': np.uint16, + f'{onnx.TensorProto.UINT32}': np.uint32, + f'{onnx.TensorProto.UINT64}': np.uint64, + f'{onnx.TensorProto.INT8}': np.int8, + f'{onnx.TensorProto.INT16}': np.int16, f'{onnx.TensorProto.INT32}': np.int32, f'{onnx.TensorProto.INT64}': np.int64, } @@ -225,6 +232,11 @@ def inference( session_option = onnxruntime.SessionOptions() session_option.log_severity_level = 4 session_option.intra_op_num_threads = intra_op_num_threads + + + # session_option.execution_mode = onnxruntime.ExecutionMode.ORT_PARALLEL + session_option.inter_op_num_threads = 19 + if sub_info: if onnx_execution_provider in ['openvino_cpu', 'openvino_gpu']: session_option.graph_optimization_level = onnxruntime.GraphOptimizationLevel.ORT_DISABLE_ALL From f8418db3f1e9fd532e092d0f56f640382711eb87 Mon Sep 17 00:00:00 2001 From: pinto0309 Date: Wed, 15 Mar 2023 18:06:37 +0900 Subject: [PATCH 2/2] Remove unnecessary logic --- sit4onnx/onnx_inference_test.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/sit4onnx/onnx_inference_test.py b/sit4onnx/onnx_inference_test.py index 6999452..a62efb0 100644 --- a/sit4onnx/onnx_inference_test.py +++ b/sit4onnx/onnx_inference_test.py @@ -233,10 +233,6 @@ def inference( session_option.log_severity_level = 4 session_option.intra_op_num_threads = intra_op_num_threads - - # session_option.execution_mode = onnxruntime.ExecutionMode.ORT_PARALLEL - session_option.inter_op_num_threads = 19 - if sub_info: if onnx_execution_provider in ['openvino_cpu', 'openvino_gpu']: session_option.graph_optimization_level = onnxruntime.GraphOptimizationLevel.ORT_DISABLE_ALL