microsoft / onnxruntime-extensions

onnxruntime-extensions: A specialized pre- and post- processing library for ONNX Runtime
MIT License
295 stars 80 forks source link

onnxruntime::CustomOpKernel::CustomOpKernel(const onnxruntime::OpKernelInfo&, const OrtCustomOp&) Unsupported version '11' in custom op #696

Closed guangqianzhang closed 1 month ago

guangqianzhang commented 2 months ago

我正在尝试推理onnxruntime 自定义算子。在尝试运行项目test_pyops.py时出现 Unsupported version '11' in custom op 'PyAddEpsilon的问题。文件中并未设置op_version版本,环境onnx版本如下: i am trying to run onnx model by myself_op, but there some troubles in run test_pyops.py ,while file from onnxruntime-extensions/test/test_pyops.py in this project, but there is not setting about version=9. i am in the water,

onnx 1.16.0 onnxruntime 1.10.0 onnxruntime_extensions 0.10.1 onnxsim 0.4.36 pytorch-quantization 2.1.3 torch 1.10.0 torchaudio 0.10.0 torchpack 0.3.1 torchvision 0.11.0

/home/zgq/miniconda3/envs/dc/bin/python /home/zgq/code/DCMMDet3D/work_dirs/onnxruntime/test_pyops.py 2024-04-23 15:28:37.443787445 [W:onnxruntime:Default, schema_registry.cc:78 RegisterOpSchemaInternal] Trying to register schema with name AzureAudioToText (domain: com.microsoft.extensions version: 1) from file custom op registered at runtime line 0, but it is already registered from file custom op registered at runtime line 0

2024-04-23 15:28:37.443806469 [W:onnxruntime:Default, schema_registry.cc:78 RegisterOpSchemaInternal] Trying to register schema with name AzureTextToText (domain: com.microsoft.extensions version: 1) from file custom op registered at runtime line 0, but it is already registered from file custom op registered at runtime line 0

2024-04-23 15:28:37.443816508 [W:onnxruntime:Default, schema_registry.cc:78 RegisterOpSchemaInternal] Trying to register schema with name OpenAIAudioToText (domain: com.microsoft.extensions version: 1) from file custom op registered at runtime line 0, but it is already registered from file custom op registered at runtime line 0

2024-04-23 15:28:37.443824182 [W:onnxruntime:Default, schema_registry.cc:78 RegisterOpSchemaInternal] Trying to register schema with name AzureTritonInvoker (domain: com.microsoft.extensions version: 1) from file custom op registered at runtime line 0, but it is already registered from file custom op registered at runtime line 0

2024-04-23 15:28:37.445627441 [E:onnxruntime:, inference_session.cc:1448 operator()] Exception during initialization: /onnxruntime_src/onnxruntime/core/session/custom_ops.cc:121 onnxruntime::CustomOpKernel::CustomOpKernel(const onnxruntime::OpKernelInfo&, const OrtCustomOp&) Unsupported version '11' in custom op 'PyAddEpsilon

E2024-04-23 15:28:37.446577329 [W:onnxruntime:Default, schema_registry.cc:78 RegisterOpSchemaInternal] Trying to register schema with name AzureAudioToText (domain: com.microsoft.extensions version: 1) from file custom op registered at runtime line 0, but it is already registered from file custom op registered at runtime line 0

2024-04-23 15:28:37.446588639 [W:onnxruntime:Default, schema_registry.cc:78 RegisterOpSchemaInternal] Trying to register schema with name AzureTextToText (domain: com.microsoft.extensions version: 1) from file custom op registered at runtime line 0, but it is already registered from file custom op registered at runtime line 0

2024-04-23 15:28:37.446596063 [W:onnxruntime:Default, schema_registry.cc:78 RegisterOpSchemaInternal] Trying to register schema with name OpenAIAudioToText (domain: com.microsoft.extensions version: 1) from file custom op registered at runtime line 0, but it is already registered from file custom op registered at runtime line 0

2024-04-23 15:28:37.446602785 [W:onnxruntime:Default, schema_registry.cc:78 RegisterOpSchemaInternal] Trying to register schema with name AzureTritonInvoker (domain: com.microsoft.extensions version: 1) from file custom op registered at runtime line 0, but it is already registered from file custom op registered at runtime line 0

.2024-04-23 15:28:37.447812435 [W:onnxruntime:Default, schema_registry.cc:78 RegisterOpSchemaInternal] Trying to register schema with name AzureAudioToText (domain: com.microsoft.extensions version: 1) from file custom op registered at runtime line 0, but it is already registered from file custom op registered at runtime line 0

2024-04-23 15:28:37.447823636 [W:onnxruntime:Default, schema_registry.cc:78 RegisterOpSchemaInternal] Trying to register schema with name AzureTextToText (domain: com.microsoft.extensions version: 1) from file custom op registered at runtime line 0, but it is already registered from file custom op registered at runtime line 0

2024-04-23 15:28:37.447831360 [W:onnxruntime:Default, schema_registry.cc:78 RegisterOpSchemaInternal] Trying to register schema with name OpenAIAudioToText (domain: com.microsoft.extensions version: 1) from file custom op registered at runtime line 0, but it is already registered from file custom op registered at runtime line 0

2024-04-23 15:28:37.447838242 [W:onnxruntime:Default, schema_registry.cc:78 RegisterOpSchemaInternal] Trying to register schema with name AzureTritonInvoker (domain: com.microsoft.extensions version: 1) from file custom op registered at runtime line 0, but it is already registered from file custom op registered at runtime line 0

2024-04-23 15:28:37.448074131 [E:onnxruntime:, inference_session.cc:1448 operator()] Exception during initialization: /onnxruntime_src/onnxruntime/core/session/custom_ops.cc:121 onnxruntime::CustomOpKernel::CustomOpKernel(const onnxruntime::OpKernelInfo&, const OrtCustomOp&) Unsupported version '11' in custom op 'CustomOpOne

EE2024-04-23 15:28:37.449185483 [W:onnxruntime:Default, schema_registry.cc:78 RegisterOpSchemaInternal] Trying to register schema with name AzureAudioToText (domain: com.microsoft.extensions version: 1) from file custom op registered at runtime line 0, but it is already registered from file custom op registered at runtime line 0

2024-04-23 15:28:37.449196954 [W:onnxruntime:Default, schema_registry.cc:78 RegisterOpSchemaInternal] Trying to register schema with name AzureTextToText (domain: com.microsoft.extensions version: 1) from file custom op registered at runtime line 0, but it is already registered from file custom op registered at runtime line 0

2024-04-23 15:28:37.449204297 [W:onnxruntime:Default, schema_registry.cc:78 RegisterOpSchemaInternal] Trying to register schema with name OpenAIAudioToText (domain: com.microsoft.extensions version: 1) from file custom op registered at runtime line 0, but it is already registered from file custom op registered at runtime line 0

2024-04-23 15:28:37.449211570 [W:onnxruntime:Default, schema_registry.cc:78 RegisterOpSchemaInternal] Trying to register schema with name AzureTritonInvoker (domain: com.microsoft.extensions version: 1) from file custom op registered at runtime line 0, but it is already registered from file custom op registered at runtime line 0

2024-04-23 15:28:37.449411394 [E:onnxruntime:, inference_session.cc:1448 operator()] Exception during initialization: /onnxruntime_src/onnxruntime/core/session/custom_ops.cc:121 onnxruntime::CustomOpKernel::CustomOpKernel(const onnxruntime::OpKernelInfo&, const OrtCustomOp&) Unsupported version '11' in custom op 'PyOpJoin

E2024-04-23 15:28:37.450319716 [W:onnxruntime:Default, schema_registry.cc:78 RegisterOpSchemaInternal] Trying to register schema with name AzureAudioToText (domain: com.microsoft.extensions version: 1) from file custom op registered at runtime line 0, but it is already registered from file custom op registered at runtime line 0

2024-04-23 15:28:37.450331227 [W:onnxruntime:Default, schema_registry.cc:78 RegisterOpSchemaInternal] Trying to register schema with name AzureTextToText (domain: com.microsoft.extensions version: 1) from file custom op registered at runtime line 0, but it is already registered from file custom op registered at runtime line 0

2024-04-23 15:28:37.450338720 [W:onnxruntime:Default, schema_registry.cc:78 RegisterOpSchemaInternal] Trying to register schema with name OpenAIAudioToText (domain: com.microsoft.extensions version: 1) from file custom op registered at runtime line 0, but it is already registered from file custom op registered at runtime line 0

2024-04-23 15:28:37.450345483 [W:onnxruntime:Default, schema_registry.cc:78 RegisterOpSchemaInternal] Trying to register schema with name AzureTritonInvoker (domain: com.microsoft.extensions version: 1) from file custom op registered at runtime line 0, but it is already registered from file custom op registered at runtime line 0

2024-04-23 15:28:37.450543573 [E:onnxruntime:, inference_session.cc:1448 operator()] Exception during initialization: /onnxruntime_src/onnxruntime/core/session/custom_ops.cc:121 onnxruntime::CustomOpKernel::CustomOpKernel(const onnxruntime::OpKernelInfo&, const OrtCustomOp&) Unsupported version '11' in custom op 'PyNegPos

E2024-04-23 15:28:37.451292325 [W:onnxruntime:Default, schema_registry.cc:78 RegisterOpSchemaInternal] Trying to register schema with name AzureAudioToText (domain: com.microsoft.extensions version: 1) from file custom op registered at runtime line 0, but it is already registered from file custom op registered at runtime line 0

2024-04-23 15:28:37.451303535 [W:onnxruntime:Default, schema_registry.cc:78 RegisterOpSchemaInternal] Trying to register schema with name AzureTextToText (domain: com.microsoft.extensions version: 1) from file custom op registered at runtime line 0, but it is already registered from file custom op registered at runtime line 0

2024-04-23 15:28:37.451311179 [W:onnxruntime:Default, schema_registry.cc:78 RegisterOpSchemaInternal] Trying to register schema with name OpenAIAudioToText (domain: com.microsoft.extensions version: 1) from file custom op registered at runtime line 0, but it is already registered from file custom op registered at runtime line 0

2024-04-23 15:28:37.451318022 [W:onnxruntime:Default, schema_registry.cc:78 RegisterOpSchemaInternal] Trying to register schema with name AzureTritonInvoker (domain: com.microsoft.extensions version: 1) from file custom op registered at runtime line 0, but it is already registered from file custom op registered at runtime line 0

2024-04-23 15:28:37.451512135 [E:onnxruntime:, inference_session.cc:1448 operator()] Exception during initialization: /onnxruntime_src/onnxruntime/core/session/custom_ops.cc:121 onnxruntime::CustomOpKernel::CustomOpKernel(const onnxruntime::OpKernelInfo&, const OrtCustomOp&) Unsupported version '11' in custom op 'PyReverseMatrix

E

ERROR: test_add_epsilon_python (main.TestPythonOp)

Traceback (most recent call last): File "/home/zgq/code/DCMMDet3D/work_dirs/onnxruntime/test_pyops.py", line 168, in test_add_epsilon_python sess = _ort.InferenceSession(onnx_model.SerializeToString(), so, providers=['CPUExecutionProvider']) File "/home/zgq/miniconda3/envs/dc/lib/python3.8/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 335, in init self._create_inference_session(providers, provider_options, disabled_optimizers) File "/home/zgq/miniconda3/envs/dc/lib/python3.8/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 379, in _create_inference_session sess.initialize_session(providers, provider_options, disabled_optimizers) onnxruntime.capi.onnxruntime_pybind11_state.RuntimeException: [ONNXRuntimeError] : 6 : RUNTIME_EXCEPTION : Exception during initialization: /onnxruntime_src/onnxruntime/core/session/custom_ops.cc:121 onnxruntime::CustomOpKernel::CustomOpKernel(const onnxruntime::OpKernelInfo&, const OrtCustomOp&) Unsupported version '11' in custom op 'PyAddEpsilon

====================================================================== ERROR: test_cc_operator (main.TestPythonOp)

Traceback (most recent call last): File "/home/zgq/code/DCMMDet3D/work_dirs/onnxruntime/test_pyops.py", line 213, in test_cc_operator sess0 = _ort.InferenceSession(ser, so, providers=['CPUExecutionProvider']) File "/home/zgq/miniconda3/envs/dc/lib/python3.8/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 335, in init self._create_inference_session(providers, provider_options, disabled_optimizers) File "/home/zgq/miniconda3/envs/dc/lib/python3.8/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 379, in _create_inference_session sess.initialize_session(providers, provider_options, disabled_optimizers) onnxruntime.capi.onnxruntime_pybind11_state.RuntimeException: [ONNXRuntimeError] : 6 : RUNTIME_EXCEPTION : Exception during initialization: /onnxruntime_src/onnxruntime/core/session/custom_ops.cc:121 onnxruntime::CustomOpKernel::CustomOpKernel(const onnxruntime::OpKernelInfo&, const OrtCustomOp&) Unsupported version '11' in custom op 'CustomOpOne

====================================================================== ERROR: test_check_saved_model (main.TestPythonOp)

Traceback (most recent call last): File "/home/zgq/code/DCMMDet3D/work_dirs/onnxruntime/test_pyops.py", line 202, in test_check_saved_model with open(os.path.join(this, 'data', 'custom_op_test.onnx'), FileNotFoundError: [Errno 2] No such file or directory: '/home/zgq/code/DCMMDet3D/work_dirs/onnxruntime/data/custom_op_test.onnx'

====================================================================== ERROR: test_python_join (main.TestPythonOp)

Traceback (most recent call last): File "/home/zgq/code/DCMMDet3D/work_dirs/onnxruntime/test_pyops.py", line 224, in test_python_join sess = _ort.InferenceSession(onnx_model.SerializeToString(), so, providers=['CPUExecutionProvider']) File "/home/zgq/miniconda3/envs/dc/lib/python3.8/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 335, in init self._create_inference_session(providers, provider_options, disabled_optimizers) File "/home/zgq/miniconda3/envs/dc/lib/python3.8/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 379, in _create_inference_session sess.initialize_session(providers, provider_options, disabled_optimizers) onnxruntime.capi.onnxruntime_pybind11_state.RuntimeException: [ONNXRuntimeError] : 6 : RUNTIME_EXCEPTION : Exception during initialization: /onnxruntime_src/onnxruntime/core/session/custom_ops.cc:121 onnxruntime::CustomOpKernel::CustomOpKernel(const onnxruntime::OpKernelInfo&, const OrtCustomOp&) Unsupported version '11' in custom op 'PyOpJoin

====================================================================== ERROR: test_python_negpos (main.TestPythonOp)

Traceback (most recent call last): File "/home/zgq/code/DCMMDet3D/work_dirs/onnxruntime/test_pyops.py", line 179, in test_python_negpos sess = _ort.InferenceSession(onnx_model.SerializeToString(), so, providers=['CPUExecutionProvider']) File "/home/zgq/miniconda3/envs/dc/lib/python3.8/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 335, in init self._create_inference_session(providers, provider_options, disabled_optimizers) File "/home/zgq/miniconda3/envs/dc/lib/python3.8/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 379, in _create_inference_session sess.initialize_session(providers, provider_options, disabled_optimizers) onnxruntime.capi.onnxruntime_pybind11_state.RuntimeException: [ONNXRuntimeError] : 6 : RUNTIME_EXCEPTION : Exception during initialization: /onnxruntime_src/onnxruntime/core/session/custom_ops.cc:121 onnxruntime::CustomOpKernel::CustomOpKernel(const onnxruntime::OpKernelInfo&, const OrtCustomOp&) Unsupported version '11' in custom op 'PyNegPos


Ran 7 tests in 0.009s

FAILED (errors=6)

wenbingl commented 2 months ago

onnxruntime-extensions needs a ONNXRuntime over than version 1.11, the higher the better, since some API function are only available after that version. That's why you see the error message of "Unsupported version '11' ", which is equal to onnxruntime 1.11.

guangqianzhang commented 2 months ago

thanks for replay。 i will update the version number

---- Replied Message ---- | From | Wenbing @.> | | Date | 05/01/2024 02:31 | | To | microsoft/onnxruntime-extensions @.> | | Cc | guangqianzhang @.>, Author @.> | | Subject | Re: [microsoft/onnxruntime-extensions] onnxruntime::CustomOpKernel::CustomOpKernel(const onnxruntime::OpKernelInfo&, const OrtCustomOp&) Unsupported version '11' in custom op (Issue #696) |

onnxruntime-extensions needs a ONNXRuntime over than version 1.11, the higher the better, since some API function are only available after that version. That's why you see the error message of "Unsupported version '11' ", which is equal to onnxruntime 1.11.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>