Target and input size different

Here is my snippet of code:

x,y = dls.one_batch()
x.shape,y.shape
# (torch.Size([2, 3, 1024, 1024]), torch.Size([2, 1024, 1024, 3]))
learn.freeze()
learn.loss_func = custom_loss_func

# finally this line gives me error:
learn.fit(1, 1e-4, wd=1e-5)

# /opt/conda/lib/python3.7/site-packages/torch/_tensor.py:1051: UserWarning: Using a target size 
# (torch.Size([2, 1024, 1024, 3])) that is different to the input size (torch.Size([2, 4, 1024, 1024])). 
# This will likely lead to incorrect results due to broadcasting. Please ensure they have the same size.
#   ret = func(*args, **kwargs)

# RuntimeError: The size of tensor a (1024) must match the size of tensor b (3) at non-singleton dimension 3

Why is the input size changed to (torch.Size([2, 4, 1024, 1024])?