The white image might be an issue due to the color encoding. For a floating point image you might want to scale all of the colors to be between 0.0 and 1.0 instead of 0 and 255.
For your second question, it depends on what the loss function criterion used by default is. For a classification model, a typical label format has the shape N (N = batch), where the label is the class index so we only need one value per example. If your label format is N,H,W, then this corresponds to a class index per pixel. Note that masks in this second format by default are NOT renderable as images by default. Even if we remove the batch dimension, the H,W format doesn’t have a color dimension. I think the black and white image is the result of the class index being interpreted as colors, as class 0 can be black, while class 1 and 2 and simply clamped to 1.0 and displayed as white. In other words, there is no indication that the mask being loaded is incorrect, as it should not be correctly displayable as an image without being converted into a format with color information.