-
Notifications
You must be signed in to change notification settings - Fork 139
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
Problem on running language model example code in "dp" package with cuda option #162
Comments
Can you try running the script after updating dp, rnn, dpnn, nn, cunn ? |
Thanks for the comment. I tried updating the packages above and run the script again, but still same problem... |
@kkjh0723 Yeah you can update with luarocks install [package] or cd package
luarocks make rocks/[package.rockspec] I just tried running that exact command :
I get no NaNs. |
@nicholas-leonard thanks again!! Then, is it because of GPU difference? or driver? do you have any clue?? |
Hi all,
I recently started to study torch7 and found some example codes in 'dp' package.
At first I try to run languagemodel.lua with CPU, and it worked. I tried both without option and with some options(softmaxtree, progress...).
Each epoch it shows like this,
==> epoch # 1 for optimizer :
[============================= 1000000/1000000 ==================>] ETA: 0ms | Step: 0ms
==> example speed = 2685.9343208491 examples/s
[============================= 100000/100000 ====================>] ETA: 0ms | Step: 0ms
jinhyung:1442886446:1:optimizer:loss avgErr 0.027386303028322
jinhyung:1442886446:1:optimizer:perplexity perplexity = 1107.1536726439
jinhyung:1442886446:1:validator:perplexity perplexity = 901.22609355108
jinhyung:1442886446:1:tester:perplexity perplexity = 905.12637877775
Then, I run it with cuda option. When I run without softmaxtree option, it's not running.
So I tried with softmaxtree option(th languagemodel.lua --progress --cuda --softmaxtree). At first it run and seemed work but the values of loss and perplexity were all 'nan'. Like below,
{
accUpdate : false
batchNorm : false
batchSize : 256
contextSize : 5
cuda : true
dropout : false
forestGaterSize : {}
hiddenSize : {200}
inputEmbeddingSize : 100
learningRate : 0.1
maxEpoch : 400
maxOutNorm : 2
maxTries : 30
momentum : 0
outputEmbeddingSize : 100
progress : true
schedule : {[250]=0.01,[350]=0.001}
silent : false
small : false
softmaxforest : false
softmaxtree : true
tiny : false
trainEpochSize : 1000000
trainOnly : false
useDevice : 1
validEpochSize : 100000
}
Input to first hidden layer has 500 neurons.
Model :
nn.Sequential {
input -> (1) -> (2) -> output: nn.ParallelTable {
input
|
-> (1): nn.Sequential { | [input -> (1) -> (2) -> (3) -> (4) -> (5) -> (6) -> output] | (1): nn.Dictionary | (2): nn.Collapse | (3): nn.Linear(500 -> 200) | (4): nn.Tanh | (5): nn.Linear(200 -> 100) | (6): nn.Tanh | } |
-> (2): nn.Convert... -> output
}
(2): nn.SoftMaxTree
}
FileLogger: log will be written to /home/jinhyung/save/jinhyung:1442844325:1/log
==> epoch # 1 for optimizer :
[=================== 1000000/1000000 =========>] ETA: 0ms | Step: 0ms
==> example speed = 6141.5748786068 examples/s
[=================== 100000/100000 ===========>] ETA: 0ms | Step: 0ms
jinhyung:1442844325:1:optimizer:loss avgErr nan
jinhyung:1442844325:1:optimizer:perplexity perplexity = nan
jinhyung:1442844325:1:validator:perplexity perplexity = nan
jinhyung:1442844325:1:tester:perplexity perplexity = nan
==> epoch # 2 for optimizer :
[=================== 1000000/1000000 =========>] ETA: 0ms | Step: 0ms
==> example speed = 5911.7152838998 examples/s
[=================== 100000/100000 ===========>] ETA: 0ms | Step: 0ms
jinhyung:1442844325:1:optimizer:loss avgErr nan
jinhyung:1442844325:1:optimizer:perplexity perplexity = nan
jinhyung:1442844325:1:validator:perplexity perplexity = nan
jinhyung:1442844325:1:tester:perplexity perplexity = nan
==> epoch # 3 for optimizer :
[=================== 1000000/1000000 =========>] ETA: 0ms | Step: 0ms
==> example speed = 5907.3460937005 examples/s
[=================== 100000/100000 ===========>] ETA: 0ms | Step: 0ms
jinhyung:1442844325:1:optimizer:loss avgErr nan
jinhyung:1442844325:1:optimizer:perplexity perplexity = nan
jinhyung:1442844325:1:validator:perplexity perplexity = nan
jinhyung:1442844325:1:tester:perplexity perplexity = nan
I'm not sure what's wrong. Is that a cuda problem? or do I need to install some other packages?
Please advise me how to solve this problem.
The text was updated successfully, but these errors were encountered: