As you’ve explained, nn.MSELoss expects the model output and target to have the same shape.
Since your target shape differs, you would have to explain a bit more how the loss calculation should be performed for your use case.
E.g. you could repeat the target values for each channel and pixel, but I doubt this would fit your use case.