Browse Source

Restrict TRT autoinstall to Linux-only (#7549)

May partially resolve concerns in https://github.com/ultralytics/yolov5/pull/7537#discussion_r856843711
modifyDataloader
Glenn Jocher GitHub 2 years ago
parent
commit
1f1ec1c3e7
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      export.py

+ 2
- 1
export.py View File

@@ -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

Loading…
Cancel
Save