Skip to content

Commit

Permalink
Update common.py
Browse files Browse the repository at this point in the history
Fixed a bug. When using a higher version of tensorrt and val.py to verify the model, the following problems may occur:
getPluginCreator could not find plugin: InstanceNormalization_TRT version: 1
Serialization assertion creator failed.Cannot deserialize plugin since corresponding IPluginCreator not found in Plugin Registry

Signed-off-by: Melt <60842553+NeKoooo233@users.noreply.github.com>
  • Loading branch information
NeKoooo233 committed May 5, 2024
1 parent b599ae4 commit c69abeb
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions models/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,7 @@ def __init__(self, weights="yolov5s.pt", device=torch.device("cpu"), dnn=False,
Binding = namedtuple("Binding", ("name", "dtype", "shape", "data", "ptr"))
logger = trt.Logger(trt.Logger.INFO)
with open(w, "rb") as f, trt.Runtime(logger) as runtime:
trt.init_libnvinfer_plugins(None, "")
model = runtime.deserialize_cuda_engine(f.read())
context = model.create_execution_context()
bindings = OrderedDict()
Expand Down

0 comments on commit c69abeb

Please sign in to comment.