Debug a shape mismatch in a PyTorch U-Net

0
Remix

A U-Net written in PyTorch fails with a tensor shape mismatch. Find the cause (typically where skip connections are concatenated with upsampled features whose size no longer matches after pooling and convolutions), fix it, and explain how you would make the model work for any input size.

AppleTechnical phone screenLast asked Mar 2026
No answer yet. Write the first one; the best answer gets endorsed.