Applying saved trained model to differently sized test data


I have a neural network model in pytorch that was trained on a labeled dataset where feature selection was performed (2000 → 800 features). Now I want to apply this model to an unlabeled test dataset. However, this test dataset still has the old number of features (2000). I saved the trained model using pickle and Pytorch’s state dict saving function, but both options give me dimension errors when I want to apply the model to the test set.
How can I save and load my model in such a way that it works on the new data size? Thanks!

Could you post the model definition, the code raising this error, as well as the complete error message, please? :slight_smile: