Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix TensorRT Windows Python interface compatibility #396

Merged
merged 2 commits into from
Apr 29, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions yolort/runtime/y_tensorrt.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,19 @@
from collections import OrderedDict, namedtuple
from typing import Any, Dict, List, Callable, Optional, Tuple

# import yolort before pytorch: this may cause issue in python inference on windows
import yolort.utils.dependency as _dependency

if _dependency.is_module_available("tensorrt"):
import tensorrt as trt

import numpy as np
import torch
import yolort.utils.dependency as _dependency
from torch import Tensor
from torchvision.io import read_image
from yolort.models.transform import YOLOTransform
from yolort.utils import contains_any_tensor

if _dependency.is_module_available("tensorrt"):
import tensorrt as trt

logging.basicConfig(level=logging.INFO)
logging.getLogger("PredictorTRT").setLevel(logging.INFO)
Expand Down