From a8635c78a1be0fe9b283220b4b8a4c777fade105 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Sat, 23 Apr 2022 09:31:30 -0700 Subject: [PATCH] Restrict TRT autoinstall to Linux-only May partially resolve concerns in https://github.com/ultralytics/yolov5/pull/7537#discussion_r856843711 --- export.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/export.py b/export.py index d7aff0d4b4e1..3b85dfc27f27 100644 --- a/export.py +++ b/export.py @@ -218,7 +218,8 @@ def export_engine(model, im, file, train, half, simplify, workspace=4, verbose=F # YOLOv5 TensorRT export https://developer.nvidia.com/tensorrt try: assert im.device.type != 'cpu', 'export running on CPU but must be on GPU, i.e. `python export.py --device 0`' - check_requirements(('nvidia-tensorrt',), cmds=('-U --index-url https://pypi.ngc.nvidia.com',)) + if platform.system() == 'Linux': + check_requirements(('nvidia-tensorrt',), cmds=('-U --index-url https://pypi.ngc.nvidia.com',)) import tensorrt as trt if trt.__version__[0] == '7': # TensorRT 7 handling https://github.com/ultralytics/yolov5/issues/6012