I have a Sentiment model trained using glove vectors refer https://blog.floydhub.com/long-short-term-memory-from-zero-to-hero-with-pytorch/.
I save the trained mode and dictionary
I try to recreate the model for inference
model = torch.load(‘trained_lstm.pt’, map_location=torch.device(“cpu”))
but keep getting error cannot get attribute SentimentNet in module main. If I just load the state dictionary i get error on embedding and weight sizes.
I included the model class in the same file while saving and reloading. Any help ?