Newbie question here. I saved my model using
torch.save(dual_encoder.state_dict(), ‘SAVED_MODEL.pt’) in the file in which I train my model.
Now in the file in which I want to evaluate my model, I tried the following (based on this pytorch explanation) 15:
import torch
import model
encoder_model = model.Encoder(
input_size = model.emb_dim,
hidden_size = 200,
vocab_size = model.vocab_len)
dual_encoder = model.DualEncoder(encoder_model)
dual_encoder.eval()
dual_encoder.training == False
dual_encoder.load_state_dict(torch.load(‘SAVED_MODEL.pt’))
I want to import the model parameters and some other variables from the model file, but what it does instead is going into training again when I try to import it…
how can I make sure it just imports stuff without starting training again?