Ah OK, in that case the error should come from the input batch.
Could you isolate the sample, which causes this error and print its shape in the training loop?
Something like this should work:
for data, target in federated_train_loader:
        print(data.shape)
        ...
        output = model(data)