Hi,
Thanks a lot. I figured it with your help. It was the image, they were not in the right format. I had to pre-process them using this tutorial here.
https://www.bulentsiyah.com/preprocessing-rgb-image-masks-to-segmentation-masks 7
Thanks again.