BatchNorm layers compute the running estimates per channel, i.e. the mean and standard deviation would be 512-dimensional tensors. Since you have only one sample in the batch and also only one “pixel” the running estimates cannot be calculated. In that case you could remove the BatchNorm layer and use e.g. InstanceNorm instead.