Closed lvaughn closed 2 years ago
Thanks for this PR!
The only issue I have with this is that it changes the behavior slightly:
use_cuda=None
meant "Use GPU if available, CPU otherwise" and use_cuda=True
meant "Always use GPU, and error if there is no GPU".use_cuda=None
is equivalent to use_cuda=False
.So to preserve old behavior, providers
should be ["CUDAExecutionProvider", "CPUExecutionProvider"]
if use_cuda=None
, only the latter if it is false and only the former if it is true.
Thanks for the feedback. I've updated the PR to reflect it.
Thanks! LGTM.
onnxruntime has deprecated creating a session without setting a provider at creation time (the latest version fails). This PR fixes the session creation.