@user_123454321   thank you very much for the fast response. The error occurs in the forward function of Generator actually.
One thing I noticed is that the size of images forward takes is 516x516 (height and width) when I print. Although I explicitly resized the images to 512 x512 and this is the size network accepts . This is the apparent reason of error. I am trying to check in the DataLoader where this dimension mismatch is occurring.
I will post here if there is still tensor size mismatch in the later layers of network.
thanks a lot for your suggestions.