Print value errors in ort.InferenceSession to user (#15360)

This commit is contained in:
Hariharan Seshadri 2023-04-04 16:01:24 -07:00 committed by GitHub
parent 207c57219a
commit 5294cd0c55
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -367,9 +367,9 @@ class InferenceSession(Session):
try:
self._create_inference_session(providers, provider_options, disabled_optimizers)
except ValueError:
except ValueError as e:
if self._enable_fallback:
print(f"EP Error using {providers}")
print(f"EP Error {e} when using {providers}")
print(f"Falling back to {self._fallback_providers} and retrying.")
self._create_inference_session(self._fallback_providers, None)
# Fallback only once.