I guess you might be passing the input in a wrong shape to these layers, as your setup works fine:
num_classes = 10
fc1 = nn.Linear(2048, 246)
fc2 = nn.Linear(246, num_classes)
x = torch.randn(1, 2048)
out = fc1(x)
out = fc2(out)
print(out.shape)
> torch.Size([1, 10])