@Nikronic
I think the problem is because ToTensor custom method returns a dictionary.
I changed code to below:
transformed_train_dataset = MasksTrainDataset(csv_file='pneumo_input/train/train-rle.csv',
                                           root_dir='pneumo_input/train/images/256/dicom/',
                                           transform=transforms.Compose([
                                               Rescale(224),
                                               ToTensor(),
                                               transforms.Lambda(lambda x: x['image'].repeat(1, 1, 1)),
                                               transforms.Normalize(mean=[0.5, 0.5, 0.5],std=[0.5, 0.5, 0.5]),
                                           ]))

and normalization works. BUT now with Lambda function I lose labels (x[‘masks’]).
I found where is the problem though. So I have to normalize image before returning a dictionary at ToTensor custom method.