image = (np.random.random((416, 416, 3)) * 250).astype('uint8')
im = Image.fromarray(image)
x = TF.to_tensor(im)
x.cuda()
x = x.unsqueeze_(0)
x = Variable(x)
# Get detections
with torch.no_grad():
detections = model(input_imgs)
detections = non_max_suppression(detections, opt.conf_thres, opt.nms_thres)
got error:
Input type (torch.FloatTensor) and weight type (torch.cuda.FloatTensor) should be the same
so I check and got:
x.is_cuda = False