import torch
from skimage import io
img = io.imread('input.png')
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
print(device)
img =torch.tensor(img, device=device).float()
print(img.device)
Output
cuda:0
cpu
I am not able to convert a numpy array into a torch tensor on GPU. What is the right way to do this?
