Skip to content

Commit 2d248f3

Browse files
glenn-jocherClay Januhowski
authored andcommitted
Restrict TRT autoinstall to Linux-only (ultralytics#7549)
May partially resolve concerns in ultralytics#7537 (comment)
1 parent 7fb5bb3 commit 2d248f3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

export.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,8 @@ def export_engine(model, im, file, train, half, simplify, workspace=4, verbose=F
337337
# YOLOv5 TensorRT export https://developer.nvidia.com/tensorrt
338338
try:
339339
assert im.device.type != 'cpu', 'export running on CPU but must be on GPU, i.e. `python export.py --device 0`'
340-
check_requirements(('nvidia-tensorrt',), cmds=('-U --index-url https://pypi.ngc.nvidia.com',))
340+
if platform.system() == 'Linux':
341+
check_requirements(('nvidia-tensorrt',), cmds=('-U --index-url https://pypi.ngc.nvidia.com',))
341342
import tensorrt as trt
342343

343344
if trt.__version__[0] == '7': # TensorRT 7 handling https://github.com/ultralytics/yolov5/issues/6012

0 commit comments

Comments
 (0)