I tried training a UNet model written in pytorch but i cant seem to make it work. I tried training on a single image (the dataset is Carvana) for 500 epochs but the output is pure black. Any help would be appreciated.
Iām a little bit concerned about the transformation applied on the target.
If you are loading a valid segmentation mask containing only the class indices (in your case it should be zeros for background and ones for the car), the Resize and ToTensor transformations might mess up the target values.
For Resize you should use PIL.Image.NEAREST as the interpolation, since PIL.Image.BILINEAR is the default one and will interpolate to invalid class indices at the borders.
Depending which image type you are passing to ToTensor, this might also normalize the image, which might further cause trouble.
Could you print some target tensors and just make a sanity check, that they only contain your desired class indices?
I resized the images using PIL.Image.NEAREST and the result seems the same, i think the ToTensor method normalizez the image becouse the values of the image are betweem -1 and 1. I have one output channel, is this a problem?