Skip to content

Commit

Permalink
Add ONNX inference providers
Browse files Browse the repository at this point in the history
Fix for #5916
  • Loading branch information
glenn-jocher authored Dec 8, 2021
1 parent 554f782 commit d80d80a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion models/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ def __init__(self, weights='yolov5s.pt', device=None, dnn=False):
LOGGER.info(f'Loading {w} for ONNX Runtime inference...')
check_requirements(('onnx', 'onnxruntime-gpu' if torch.cuda.is_available() else 'onnxruntime'))
import onnxruntime
session = onnxruntime.InferenceSession(w, None)
session = onnxruntime.InferenceSession(w, providers=['CUDAExecutionProvider', 'CPUExecutionProvider'])
elif engine: # TensorRT
LOGGER.info(f'Loading {w} for TensorRT inference...')
import tensorrt as trt # https://developer.nvidia.com/nvidia-tensorrt-download
Expand Down

0 comments on commit d80d80a

Please sign in to comment.