10000 Restrict TRT autoinstall to Linux-only (#7549) · brinkqiang2python/yolov5@1f1ec1c · GitHub
[go: up one dir, main page]

Skip to content

Commit 1f1ec1c

Browse files
authored
Restrict TRT autoinstall to Linux-only (ultralytics#7549)
May partially resolve concerns in ultralytics#7537 (comment)
1 parent 404b4fe commit 1f1ec1c

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
@@ -218,7 +218,8 @@ def export_engine(model, im, file, train, half, simplify, workspace=4, verbose=F
218218
# YOLOv5 TensorRT export https://developer.nvidia.com/tensorrt
219219
try:
220220
assert im.device.type != 'cpu', 'export running on CPU but must be on GPU, i.e. `python export.py --device 0`'
221-
check_requirements(('nvidia-tensorrt',), cmds=('-U --index-url https://pypi.ngc.nvidia.com',))
221+
if platform.system() == 'Linux':
222+
check_requirements(('nvidia-tensorrt',), cmds=('-U --index-url https://pypi.ngc.nvidia.com',))
222223
import tensorrt as trt
223224

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

0 commit comments

Comments
 (0)
0