From c1249a47c7fe19e2067cb25ed8347e67d26ff1f1 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Thu, 16 Dec 2021 14:10:54 +0100 Subject: [PATCH] *.torchscript inference `self.jit` fix (#6007) --- models/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/common.py b/models/common.py index 4f1afa13396c..cfecb20d2141 100644 --- a/models/common.py +++ b/models/common.py @@ -379,7 +379,7 @@ def wrap_frozen_graph(gd, inputs, outputs): def forward(self, im, augment=False, visualize=False, val=False): # YOLOv5 MultiBackend inference b, ch, h, w = im.shape # batch, channel, height, width - if self.pt: # PyTorch + if self.pt or self.jit: # PyTorch y = self.model(im) if self.jit else self.model(im, augment=augment, visualize=visualize) return y if val else y[0] elif self.coreml: # CoreML