Unverified 提交 b754525e authored 作者: Glenn Jocher's avatar Glenn Jocher 提交者: GitHub

Check `'onnxruntime-gpu' if torch.has_cuda` (#5087)

* Check `'onnxruntime-gpu' if torch.has_cuda` * fix indent
上级 20a809de
......@@ -92,7 +92,7 @@ def run(weights=ROOT / 'yolov5s.pt', # model.pt path(s)
# check_requirements(('opencv-python>=4.5.4',))
net = cv2.dnn.readNetFromONNX(w)
else:
check_requirements(('onnx', 'onnxruntime'))
check_requirements(('onnx', 'onnxruntime-gpu' if torch.has_cuda else 'onnxruntime'))
import onnxruntime
session = onnxruntime.InferenceSession(w, None)
else: # TensorFlow models
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论