Exclude tensorrt==10.2.0 to fix libnvinfer_builder_resource_win.so.10.2.0 error (#24367)
Signed-off-by: Lakshantha Dissanayake <lakshantha@ultralytics.com> Co-authored-by: UltralyticsAssistant <web@ultralytics.com> Co-authored-by: Laughing-q <1185102784@qq.com>
This commit is contained in:
parent
c5a0e0331e
commit
a2ae024ef2
@ -9,8 +9,8 @@ from pathlib import Path
|
||||
import numpy as np
|
||||
import torch
|
||||
|
||||
from ultralytics.utils import IS_JETSON, LINUX, LOGGER, PYTHON_VERSION
|
||||
from ultralytics.utils.checks import check_requirements, check_version
|
||||
from ultralytics.utils import IS_JETSON, LOGGER, PYTHON_VERSION
|
||||
from ultralytics.utils.checks import check_requirements, check_tensorrt, check_version
|
||||
|
||||
from .base import BaseBackend
|
||||
|
||||
@ -36,12 +36,11 @@ class TensorRTBackend(BaseBackend):
|
||||
try:
|
||||
import tensorrt as trt
|
||||
except ImportError:
|
||||
if LINUX:
|
||||
check_requirements("tensorrt>7.0.0,!=10.1.0")
|
||||
check_tensorrt()
|
||||
import tensorrt as trt
|
||||
|
||||
check_version(trt.__version__, ">=7.0.0", hard=True)
|
||||
check_version(trt.__version__, "!=10.1.0", msg="https://github.com/ultralytics/ultralytics/pull/14239")
|
||||
check_version(trt.__version__, "!=10.2.0", msg="https://github.com/ultralytics/ultralytics/pull/24367")
|
||||
|
||||
if self.device.type == "cpu":
|
||||
self.device = torch.device("cuda:0")
|
||||
|
||||
@ -531,7 +531,7 @@ def check_tensorrt(min_version: str = "7.0.0"):
|
||||
"""
|
||||
if LINUX:
|
||||
cuda_version = torch.version.cuda.split(".")[0]
|
||||
check_requirements(f"tensorrt-cu{cuda_version}>={min_version},!=10.1.0")
|
||||
check_requirements(f"tensorrt-cu{cuda_version}>={min_version},!=10.2.0")
|
||||
|
||||
|
||||
def check_torchvision():
|
||||
|
||||
@ -143,7 +143,7 @@ def onnx2engine(
|
||||
check_tensorrt()
|
||||
import tensorrt as trt
|
||||
check_version(trt.__version__, ">=7.0.0", hard=True)
|
||||
check_version(trt.__version__, "!=10.1.0", msg="https://github.com/ultralytics/ultralytics/pull/14239")
|
||||
check_version(trt.__version__, "!=10.2.0", msg="https://github.com/ultralytics/ultralytics/pull/24367")
|
||||
|
||||
LOGGER.info(f"\n{prefix} starting export with TensorRT {trt.__version__}...")
|
||||
output_file = output_file or Path(onnx_file).with_suffix(".engine")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user