Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encounter unknown exception in Initialize() #19002

Closed
yanzhechen opened this issue Jan 4, 2024 · 0 comments
Closed

Encounter unknown exception in Initialize() #19002

yanzhechen opened this issue Jan 4, 2024 · 0 comments
Labels
ep:OpenVINO issues related to OpenVINO execution provider

Comments

@yanzhechen
Copy link

Describe the issue

I was trying to do inference using onnxruntime-openvino on Intel Arc 770 with a unimatch model I converted but encountered unknown exception in initialize.

Log:

`2024-01-03 23:29:21.308832538 [E:onnxruntime:, inference_session.cc:1790 Initialize] Encountered unknown exception in Initialize()
Traceback (most recent call last):
  File "/home/yanzhech/code/unimatch/onnx_test.py", line 21, in <module>
    ort_session = ort.InferenceSession("unimatch.onnx", providers=["OpenVINOExecutionProvider"],
  File "/home/yanzhech/.conda/envs/OFVI/lib/python3.9/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 419, in __init__
    self._create_inference_session(providers, provider_options, disabled_optimizers)
  File "/home/yanzhech/.conda/envs/OFVI/lib/python3.9/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 471, in _create_inference_session
    sess.initialize_session(providers, provider_options, disabled_optimizers)
onnxruntime.capi.onnxruntime_pybind11_state.RuntimeException: [ONNXRuntimeError] : 6 : RUNTIME_EXCEPTION : Encountered unknown exception in Initialize()`

I tested with another simple model using openvino EP and can be run without issue.

I also tested that the CUDAExecutionProvider can run the unimatch model as well.

To reproduce

Package version:

onnx 1.15.0
onnxruntime-openvino 1.16.0
onnxscript 0.1.0.dev20231108
opencv-python 4.8.1.78
openvino 2023.1.0
openvino-dev 2023.1.0

Test script:

import onnx
import torch
import onnxruntime as ort 

def to_numpy(tensor):
    if tensor.dim() == 3:
        tensor = torch.unsqueeze(tensor, dim=0)
    return tensor.detach().cpu().numpy()

print(ort.get_available_providers())
print(ort.get_device())
model = onnx.load("unimatch.onnx")
print(onnx.checker.check_model(model, full_check=True))


ort_session = ort.InferenceSession("unimatch.onnx", providers=["OpenVINOExecutionProvider"],
                                          provider_options=[{"device_type":"GPU_FP16"}])


for i in range(10):
    print(f"validation for: {i}")
    x1 = torch.randn(10, 3, 384, 512, requires_grad=False)
    x2 = torch.randn(10, 3, 384, 512, requires_grad=False)
    output = ort_session.run(None, {"input1":to_numpy(x1),"input2": to_numpy(x2)})

Onnx model:
unimatch.zip

Urgency

No response

Platform

Linux

OS Version

22.04

ONNX Runtime Installation

Released Package

ONNX Runtime Version or Commit ID

1.16.0

ONNX Runtime API

Python

Architecture

X64

Execution Provider

OpenVINO

Execution Provider Library Version

onnxruntime-openvino 1.16.0

@github-actions github-actions bot added the ep:OpenVINO issues related to OpenVINO execution provider label Jan 4, 2024
@yanzhechen yanzhechen closed this as not planned Won't fix, can't repro, duplicate, stale Jan 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ep:OpenVINO issues related to OpenVINO execution provider
Projects
None yet
Development

No branches or pull requests

1 participant