Based on the error message it seems you are trying to expand a tensor with an invalid shape.
This code snippet would reproduce the issue:
x = torch.randn(27, 32, 32)
y = x.expand(1, 256, 32, 32)
> RuntimeError: The expanded size of the tensor (256) must match the existing size (27) at non-singleton dimension 1.  Target sizes: [1, 256, 32, 32].  Tensor sizes: [27, 32, 32]

You could check your model implementation for these expand calls and make sure it’s using a valid shape.