Yes, most likely the in_features of the first linear layer should be set to 1024.
To verify it, you could remove the linear and dropout layers, execute the forward pass using your current inputs, and print the shape of the output. This should show the shape after the Flatten() layer was used and would most likely show [2, 1024].