diff --git a/plugins/onnx/package-lock.json b/plugins/onnx/package-lock.json index 667fcdc433..fe4b86104d 100644 --- a/plugins/onnx/package-lock.json +++ b/plugins/onnx/package-lock.json @@ -1,12 +1,12 @@ { "name": "@scrypted/onnx", - "version": "0.1.116", + "version": "0.1.117", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@scrypted/onnx", - "version": "0.1.116", + "version": "0.1.117", "devDependencies": { "@scrypted/sdk": "file:../../sdk" } diff --git a/plugins/onnx/package.json b/plugins/onnx/package.json index 9b927ccea6..a024d713f1 100644 --- a/plugins/onnx/package.json +++ b/plugins/onnx/package.json @@ -42,5 +42,5 @@ "devDependencies": { "@scrypted/sdk": "file:../../sdk" }, - "version": "0.1.116" + "version": "0.1.117" } diff --git a/plugins/onnx/src/ort/__init__.py b/plugins/onnx/src/ort/__init__.py index d5ff0d62de..d48cb20cf3 100644 --- a/plugins/onnx/src/ort/__init__.py +++ b/plugins/onnx/src/ort/__init__.py @@ -122,7 +122,14 @@ def executor_initializer(): thread_name = threading.current_thread().name interpreter = compiled_models.pop() self.compiled_models[thread_name] = interpreter - self.provider = "CUDAExecutionProvider" if "CUDAExecutionProvider" in interpreter.get_providers() else "CPUExecutionProvider" + # remove CPUExecutionProider from providers + providers = interpreter.get_providers() + if not len(providers): + providers = ["CPUExecutionProvider"] + if "CPUExecutionProvider" in providers: + providers.remove("CPUExecutionProvider") + # join the remaining providers string + self.provider = ", ".join(providers) print('Runtime initialized on thread {}'.format(thread_name)) self.executor = concurrent.futures.ThreadPoolExecutor(