Thanks for the code!
As said before, your transformations (e.g. RandomCrop) need an image and the corresponding mask in t he same size, which is not the case.
Are the images and masked stored in different resolutions or are you resizing (one of) them?