You should transform numpy arrays to PyTorch tensors with torch.from_numpy
.
Otherwise some weird issues might occur.
img = torch.from_numpy(img).float().to(device)
You should transform numpy arrays to PyTorch tensors with torch.from_numpy
.
Otherwise some weird issues might occur.
img = torch.from_numpy(img).float().to(device)