Are you able to open these images in any picture viewer and are you seeing a valid output?
If so, it would point towards a failure in opening or deciding the images.
Are you visualizing the training and validation masks using the same or similar code?