Cuda out of memory

I am doing image segmentation. I am running out GPU memory when I train. I have tried reducing the batch size to 1 and decreasing the image size to 128. But still, I am getting Cuda out of memory.

Is this simply because my image is of very high resolution? 1 image is about 2.5mb space with a (700x1000) dimension.

2.5mb image sounds a bit big. Since you are only training on 128x128 image, try creating another directory with images resized to something smaller than 700x1000, example 500x500 and use that to create dataloader. Also, I think your image is not .jpg image. Try converting images to jpg (just use opencv to read image, and then save in another directory with .jpg extension). This will reduce the image size from 2.5mb to kbs. Apart from these 2 things, try using a smaller encoder (resnet18 or mobilenetv2 etc).
Another issue maybe the GPU memory. You should use a GPU having more than 4 GB memory, it’s very hard to train segmentation model in 4 GB GPU memory. Try using Google Colab in that case.