MWPToolkit icon indicating copy to clipboard operation
MWPToolkit copied to clipboard

The testing problems of trained model

Open jia-web opened this issue 2 years ago • 1 comments

The dimensions of the input data are shown to be different from the dimensions trained in the model when I test with the trained model. Why is this happening?

Error: RuntimeError: Error(s) in loading state_dict for GTS: size mismatch for embedder.embedder.weight: copying a param with shape torch.Size([3349, 128]) from checkpoint, the shape in current model is torch.Size([3322, 128]).

jia-web avatar Mar 05 '22 06:03 jia-web

Hi, I had the same error. In my case it was because I tried to load and test a model previously trained on a different dataset (actually a different trainset). This creates the mismatch in the embedding vocab sizes (as in your error message), since the embeddings are created at the initialization of model. See this line.

liamjxu avatar May 07 '22 16:05 liamjxu