diff --git a/classify/predict.py b/classify/predict.py index b430c0645f21..b33b5bcc9933 100644 --- a/classify/predict.py +++ b/classify/predict.py @@ -30,6 +30,7 @@ import sys from pathlib import Path +import torch import torch.backends.cudnn as cudnn import torch.nn.functional as F @@ -101,7 +102,7 @@ def run( seen, windows, dt = 0, [], (Profile(), Profile(), Profile()) for path, im, im0s, vid_cap, s in dataset: with dt[0]: - im = im.to(device) + im = torch.Tensor(im).to(device) im = im.half() if model.fp16 else im.float() # uint8 to fp16/32 if len(im.shape) == 3: im = im[None] # expand for batch dim