Skip to content

Commit

Permalink
fix(logging): runtime_type with onnx available providers
Browse files Browse the repository at this point in the history
  • Loading branch information
giuseppeambrosio97 committed Dec 5, 2024
1 parent 64e8389 commit f4c276d
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions focoos/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,14 @@ def __init__(
options.enable_profiling = opts.verbose
# options.intra_op_num_threads = 1
available_providers = ort.get_available_providers()
if opts.cuda and "CUDAExecutionProvider" not in available_providers:
self.logger.warning("CUDA ExecutionProvider not found.")
if opts.trt and "TensorrtExecutionProvider" not in available_providers:
self.logger.warning("Tensorrt ExecutionProvider not found.")
if opts.vino and "OpenVINOExecutionProvider" not in available_providers:
self.logger.warning("OpenVINO ExecutionProvider not found.")
if opts.coreml and "CoreMLExecutionProvider" not in available_providers:
self.logger.warning("CoreML ExecutionProvider not found.")
# Set providers
providers = []
dtype = np.float32
Expand Down Expand Up @@ -156,15 +164,6 @@ def __init__(
binding = None

binding = None # TODO: remove this
if opts.cuda and "CUDAExecutionProvider" not in providers:
self.logger.warning("CUDA ExecutionProvider not found.")
if opts.trt and "TensorrtExecutionProvider" not in providers:
self.logger.warning("Tensorrt ExecutionProvider not found.")
if opts.vino and "OpenVINOExecutionProvider" not in providers:
self.logger.warning("OpenVINO ExecutionProvider not found.")
if opts.coreml and "CoreMLExecutionProvider" not in providers:
self.logger.warning("CoreML ExecutionProvider not found.")

providers.append("CPUExecutionProvider")
self.dtype = dtype
self.binding = binding
Expand Down

0 comments on commit f4c276d

Please sign in to comment.