-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to save model for test? #3
Comments
Could you please show the error trace information? |
I change the code like this, and it works, thanks for your response, sorry to interrupt you if(args.predict):
` |
congratulations! And if you use fitlog, you can run 'fitlog log logs' in the project dictionary to scan the experiment result. |
Dear w5688414 or LeeSureman: if(args.predict): But it has error, which said TypeError: The type of model must be 'torch.nn.Module', got '<class'collections.OrderedDict'>' |
I want to save the trained model, and load it for prediction, here is my code:
`
saver = ModelSaver("./cache/model_ckpt_100.pkl")
model=ModelLoader.load_pytorch_model("./cache/model_ckpt_100.pkl")
ModelLoader.load_pytorch(model,"./cache/model_ckpt_100.pkl")
tester = Tester(datasets['test'], model, metrics=AccuracyMetric())
tester.test()
`
but it doesn't work, Can the author provide a way for prediction after saving the model
The text was updated successfully, but these errors were encountered: