After your advise, the result of the shapes become:
from PIL import Image
from torch.utils.data import Dataset
import numpy as np
import os

class CarvanaDataset(Dataset):
    def __init__(self, image_dir, mask_dir, transform=None):
        self.image_dir = image_dir
        self.mask_dir = mask_dir
        self.transform = transform
        self.images = os.listdir(image_dir)
        self.masks = os.listdir(mask_dir)
    def __len__(self):
        return len(self.images)

    def __getitem__(self, index):
        img_path = os.path.join(self.image_dir, self.images[index])
        mask_path = os.path.join(self.mask_dir, self.masks[index])
        image = np.array(Image.open(img_path).convert("L"))
        image = np.expand_dims(image, axis=0)
        mask = np.array(Image.open(mask_path).convert("L"), dtype=np.float32)
        mask = np.expand_dims(mask, axis=0)
        mask[mask == 255.0] = 1.0

        if self.transform is not None:
            augmentations = self.transform(image=image, mask=mask)
            image = augmentations["image"]
            mask = augmentations["mask"]

        return image, mask

if __name__ == "__main__":
    data = CarvanaDataset('C:\DeepLearning\\train\img', 'C:\DeepLearning\\train\mask')
    image, mask = data.__getitem__(0)
    print(image.shape)
    print(mask.shape)
-->
(1, 600, 600)
(1, 600, 600)

Another new error comes here when run train.py:
Traceback (most recent call last):
  File "C:/DeepLearning/UNet/train.py", line 120, in <module>
    main()
  File "C:/DeepLearning/UNet/train.py", line 98, in main
    check_accuracy(val_loader, model, device=DEVICE)
  File "C:\DeepLearning\UNet\utils.py", line 62, in check_accuracy
    for x, y in loader:
  File "C:\Users\Tsai\anaconda3\envs\tf\lib\site-packages\torch\utils\data\dataloader.py", line 517, in __next__
    data = self._next_data()
  File "C:\Users\Tsai\anaconda3\envs\tf\lib\site-packages\torch\utils\data\dataloader.py", line 1199, in _next_data
    return self._process_data(data)
  File "C:\Users\Tsai\anaconda3\envs\tf\lib\site-packages\torch\utils\data\dataloader.py", line 1225, in _process_data
    data.reraise()
  File "C:\Users\Tsai\anaconda3\envs\tf\lib\site-packages\torch\_utils.py", line 429, in reraise
    raise self.exc_type(msg)
ValueError: Caught ValueError in DataLoader worker process 0.
Original Traceback (most recent call last):
  File "C:\Users\Tsai\anaconda3\envs\tf\lib\site-packages\torch\utils\data\_utils\worker.py", line 202, in _worker_loop
    data = fetcher.fetch(index)
  File "C:\Users\Tsai\anaconda3\envs\tf\lib\site-packages\torch\utils\data\_utils\fetch.py", line 44, in fetch
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "C:\Users\Tsai\anaconda3\envs\tf\lib\site-packages\torch\utils\data\_utils\fetch.py", line 44, in <listcomp>
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "C:\DeepLearning\UNet\dataset.py", line 26, in __getitem__
    augmentations = self.transform(image=image, mask=mask)
  File "C:\Users\Tsai\anaconda3\envs\tf\lib\site-packages\albumentations\core\composition.py", line 182, in __call__
    data = t(force_apply=force_apply, **data)
  File "C:\Users\Tsai\anaconda3\envs\tf\lib\site-packages\albumentations\core\transforms_interface.py", line 89, in __call__
    return self.apply_with_params(params, **kwargs)
  File "C:\Users\Tsai\anaconda3\envs\tf\lib\site-packages\albumentations\core\transforms_interface.py", line 102, in apply_with_params
    res[key] = target_function(arg, **dict(params, **target_dependencies))
  File "C:\Users\Tsai\anaconda3\envs\tf\lib\site-packages\albumentations\augmentations\transforms.py", line 1496, in apply
    return F.normalize(image, self.mean, self.std, self.max_pixel_value)
  File "C:\Users\Tsai\anaconda3\envs\tf\lib\site-packages\albumentations\augmentations\functional.py", line 141, in normalize
    img -= mean
ValueError: operands could not be broadcast together with shapes (600,600,600) (3,) (600,600,600) 


How should I adjust my input or transform content? Thanks