-
-
Notifications
You must be signed in to change notification settings - Fork 82
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
Loading whole model #191
Comments
Please read the doc https://docs.pypots.com/en/latest/pypots.imputation.html#pypots.imputation.saits.SAITS.load_model. Each model in PyPOTS has both functions save_model() and load_model(). After your training, you will find the trained model file saved by PyPOTS. To reload it, you need to initialize a model with the same model hyperparameters, then run |
BTW, if you think SAITS and PyPOTS are useful to your work, please star🌟 them on GitHub and cite them properly in your research 😊 Thank you, Elke! This means a lot to our open-science work. |
This issue had no activity for 14 days. It will be closed in 1 week unless there is some new activity. Is this issue already resolved? |
1. Feature description
How to load a trained model, without initialising the class beforehand manually?
Since
save_model
saves the whole model and not onlymodel.state_dict()
, the model setup is saved I guess - but I don't know how to load it?The tutorials only show loading the model after it was initalised previously already.
2. Motivation
After initialising SAITS model, the trained weights can be loaded using
saits.load_model(dir)
.However, to initialise the model correctly, you need to know n_steps, n_features, etc. before loading the model.
3. Your contribution
I tired loading the model using
saits = torch.load(directory)
.This loads the module
_SAITS
.Running imputation then gives the error
AttributeError: '_SAITS' object has no attribute 'impute'
.The text was updated successfully, but these errors were encountered: