Comments (6)
Hi, I'm a rookie on torch too. However, I tried to write a sample function for this model myself (unfortunately it's super slow), and you can find it on https://github.com/LiyuanLucasLiu/lstm-char-cnn
from lstm-char-cnn.
Hi, another rookie here. The previous version using Squeeze.lua works fine.
I would like to test your sample.lua as per karpathy but it doesn't work with the previous version.
Unfortunately, when I run the new version without Squeeze.lua I get an error which references 'Squeeze': #18
Any suggestions to fix are appreciated.
Also, sample-beam.lua increases the quality of karpathy output dramatically (imho)
https://github.com/pender/char-rnn/blob/master/sample-beam.lua
Would be cool to see this working for this model.
cheers
from lstm-char-cnn.
Updated torch and everything working. Generated a quick .t7 file with lowest possible settings and only 5 epochs to test sample.lua. Following " batch_size' failed. " error generated.
Is there a value I can set to prevent this or do I have to run "main.lua" with the values given?
thanks
aaron@aaron-Macmini ~/Desktop/lstm-char-cnn-NEXT $ th sample.lua
loading data files...
Word vocab size: 4040, Char vocab size: 71
reshaping tensors...
data load done. Number of batches in train: 14, val: 2, test: 1
number of parameters in the model: 6073985
/home/aaron/torch/install/bin/luajit: /home/aaron/torch/install/share/lua/5.1/nn/THNN.lua:109: Assertion `THIndexTensor_(size)(target, 0) == batch_size' failed. at /home/aaron/torch/extra/nn/lib/THNN/generic/ClassNLLCriterion.c:43
stack traceback:
[C]: in function 'v'
/home/aaron/torch/install/share/lua/5.1/nn/THNN.lua:109: in function 'ClassNLLCriterion_updateOutput'
...ron/torch/install/share/lua/5.1/nn/ClassNLLCriterion.lua:41: in function 'forward'
sample.lua:216: in function 'sample'
sample.lua:236: in main chunk
[C]: in function 'dofile'
...aron/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
[C]: at 0x00406670
from lstm-char-cnn.
Hi, I'm not sure what caused this error (as a rookie...), but it seems that you ignored several necessary options while running sample.lua (the default value might not fit your checkpoint's setting), such as '-model'.
from lstm-char-cnn.
Thanks for your reply.
Could you supply an example of the terminal commands to run sample.lua ?
The commands should be based on running main.lua and generating the necessary .t7 file from the supplied PTB files.
This is easy with the karpathy original but not so much with this lstm version.
Thanks
from lstm-char-cnn.
Hi, I spent some time to train a new model and try sample.lua, I find that:
$ th main.lua -savefile char-large -EOS '+'
$ th sample.lua -model cv/lm_char-large_epoch25.00_81.97.t7 -gpuid 0 -cudnn 1 -length 20 -savefile tmpresult.t7 -temperature 0.5`
works fine with me.
hope it could help.
from lstm-char-cnn.
Related Issues (20)
- About the hierarchical softmax HOT 1
- Character HOT 1
- Reconstruction of table 6 from paper - Dealing with OOV words HOT 2
- error in cuda version HOT 1
- path index undefined
- problem about torch HOT 4
- OpenCL version HOT 1
- New version without Squeeze.lua causes error HOT 4
- Squeeze error HOT 1
- Image based recognision HOT 1
- How is the matrix C-k padded with zeros? HOT 1
- wrong number of arguments for function call in THNN.lua HOT 2
- shuffling the data performs worse HOT 2
- How te generate train.txt and valid.txt from personal datas ?
- Reduce memory requirement while precessing the data
- What is the task at hand ?
- cnn application
- How can I get the 2013 ACL Workshop MT data?
- Problem with LSTM-Word-Small on CPU. Only get 122 on validation and 115 on test HOT 2
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 lstm-char-cnn.