Comments (1)
By using model.state_dict() i was able to get the weights.
To save model with it's weight - torch.save([model, criterion, optimizer, model.state_dict()], f)
To load model, criterion, optimizer, state_dic = torch.load(f)
. f refers to model file that you saved to.
from awd-lstm-lm.
Related Issues (20)
- save model
- Hyper parameter settings for PyTorch 1.0? HOT 2
- possible error on the neural cache model, pointer? Why use the groundtruth data? HOT 1
- Problems with the next word predictions
- Language model infer
- Increasingly occupied GPU memory HOT 6
- Score a test sentence
- AttributeError: 'Program' object has no attribute '_program' HOT 1
- AssertionError HOT 1
- why is hidden layer initialized only on beginning of an epoch? HOT 2
- Dropconnect layer implementation.
- TypeError: cannot assign 'torch.cuda.FloatTensor' as parameter 'weight_hh_l0' (torch.nn.Parameter or None expected) HOT 1
- Hidden state init of LSTM layers (after the first) HOT 3
- torch.cuda.FloatTensor
- AttributeError: 'LSTM' object has no attribute 'weight_hh_l0' HOT 1
- A UsingWarning about call flatten_parameters()
- val_loss suddenly increases to a larger number(from ~5 to more than 10000) HOT 1
- The model behaves normally during training, but during prediction, the weightdrop mechanism cannot be stopped and an error is reported
- The might be a bug in splitcross.py
- initial input dropout mask is not considered.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from awd-lstm-lm.