torchvision.transforms won’t take a dict, so you should call the transformations on your data and target directly or you could write an own transform method in your Dataset, which takes the specified dict as its input.
Besides that, note that the default tensor image shape in PyTorch is [batch_size, channels, height, width]. Currently it looks like the channel dimension is in a wrong position.
Also, could you give us some information on the segmentation mask? Based on the given shape it looks like the segmentation mask is a color image. If you would like to use a standard classification criterion like nn.CrossEntropyLoss, you would have to transform the colors to a class index.
If I’m correct in my assumption about the segmentation mask (different colors correspond to different classes), you should also be careful with the normalization, since this might distort your indices.