Well, I managed to get past the tuple error.
I get this:
TypeError: expected np.ndarray (got tuple)

It comes from the:
image = torch.from_numpy(imagepre)

line. Do you know how I’d go about converting a tuple to torch tensor?