Getting 'tensor is not a torch image' for data type 
As the question suggests, I'm trying to convert images to tensor.

X, y = train_sequence[idx]  

images = Variable(torch.from_numpy(X)).to(device) # [batch, channel, H, W]
masks = Variable(torch.from_numpy(y)).to(device) 
print(type(images)) ## Output: &lt;class 'torch.Tensor'&gt;


images = transforms.Normalize((0.5, 0.5, 0.5, 0.5, 0.5), (0.5, 0.5, 0.5,0.5, 0.5))(images)
masks =  transforms.Normalize((0.5), (0.5))(masks)


But I get the error at
 ---&gt; 19         images = transforms.Normalize((0.5, 0.5, 0.5, 0.5, 0.5), (0.5, 0.5, 0.5,0.5, 0.5))(images)

TypeError: tensor is not a torch image.

This is because as of now, torchvison.transforms.Normalize only supports images with 2 or 3 channels, without the batch dimension, ie. (C, H, W). So instead of passing in a 4D tensor, something like this would work:

image = torch.ones(3, 64, 64)
image = transforms.Noramalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5))(image)


Also, because the 0.5 values represent the mean and standard deviation of the image channels, there should normally only be 3 channels (you don't "normalise" the batch dimension, only the spatial ones), so instead of using a tuple of length 5, do (0.5, 0.5, 0.5).
