RuntimeError: expected scalar type Byte but found Float

img = torch.from_numpy( cv2.imread('C:/Users/gaojo/Desktop/22.png') )

改为 :

img = torch.from_numpy( cv2.imread('C:/Users/gaojo/Desktop/22.png') ).float()

你可能感兴趣的:(python,与,pytorch,pytorch)