dlr-eoc / ukis-csmask

UKIS Cloud Shadow MASK

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support latest versions of onnxruntime

MWieland opened this issue · comments

commented

onnxruntime>1.9 requires to specifically set execution providers. Running ukis-csmask with latest version of onnxruntime therefore fails with the following error:

ValueError: This ORT build has ['TensorrtExecutionProvider', 'CUDAExecutionProvider', 'CPUExecutionProvider'] enabled. Since ORT 1.9, you are required to explicitly set the providers parameter when instanti...

simply adding the available providers to the session would resolve this. here's an example how we could do this:

sess = onnxruntime.InferenceSession(
    str(Path(__file__).parent) + "/model.onnx", providers=onnxruntime.get_available_providers()
)