You haven’t posted the complete model definition, so you would have to dig into your code and search for the offending line of code.
This dummy code snippet raises the same error:
lin = nn.Linear(5986, 28)
x = torch.randn(5986, 100)
out = lin(x)

As you can see, I’m passing x in the wrong shape. While 5986 features are expected, I’m using 5986 as the batch size and pass 100 features.