MatchZoo-py
MatchZoo-py copied to clipboard
How to load a pretrained model?
After using trainer.save() to save the model. How can I load this model and evaluate it? Thanks!
trainer = mz.trainers.Trainer(..., checkpoint=\path\to\your\saved\model)
@caiyinqiong @Chriskuei Hi~ I have an anthor question about loading pretrained model. When we Instantiate a trainer, it seems that the parameter trainloader
and validloader
must be passed in with strict type check. To get these two loaders requires inconvenient time for data preprocessing. However, if we just use trainer to predict or evaluate, there is no need to get trainloader
and validloader
. This seems to be an unreasonable design. Or do you have any idea to solve this problem? Thanks.
@RenShuhuai-Andy I used the code in the tutorial-conv-knrm. And I use trainer.restore_model('./pretrained_cknrm/1/model.pt') print(trainer.evaluate(testloader)) But why I get different result every time?