sriniiyer/codenn

error when I run ./run.sh {csharp}

Closed this issue · 10 comments

when I run ./run.sh {csharp}, an error occurs.
I installed Torch7 in my PC. Is there a version mistake of torch?
/home/jinyuliu/torch/install/bin/luajit: cannot open <./workdir/vocab.data.{csharp}> in mode r at /home/jinyuliu/torch/pkg/torch/lib/TH/THDiskFile.c:673
stack traceback:
[C]: at 0x7fd108b9e460
[C]: in function 'DiskFile'
/home/jinyuliu/torch/install/share/lua/5.1/torch/File.lua:405: in function 'load'
main.lua:102: in function 'main'
main.lua:215: in main chunk
[C]: in function 'dofile'
...uliu/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk
[C]: at 0x00405d50
{
beam_size : 10
batch_size : 100
max_code_length : 100
max_nl_length : 100
layers : 1
max_length : 20
rnn_size : 400
}
/home/jinyuliu/torch/install/bin/luajit: cannot open <./workdir/vocab.data.{csharp}> in mode r at /home/jinyuliu/torch/pkg/torch/lib/TH/THDiskFile.c:673
stack traceback:
[C]: at 0x7fdd87637460
[C]: in function 'DiskFile'
/home/jinyuliu/torch/install/share/lua/5.1/torch/File.lua:405: in function 'load'
predict.lua:213: in function 'main'
predict.lua:251: in main chunk
[C]: in function 'dofile'
...uliu/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk
[C]: at 0x00405d50

did you run buildData?

of course, I run 'buildData'

Wait, you have to just use csharp, not {csharp} . The {} denotes that you can swap the language with sql/python etc.

vocab.data.charp ? What is charp?

Sorry about that, I'm so careless...
Now I run ./run.sh csharp correctly, but another error occurs...
Total Tokens: 31667
Total Words: 7470
{
batch_size : 100
learningRate : 0.5
max_length : 20
init_weight : 0.35
decay : 0.8
gpu : 1
max_grad_norm : 5
decoder_emb : 400
max_code_length : 100
dev_ref_file : "/home/jinyuliu/codenn/data/stackoverflow/csharp/dev/ref.txt"
normalize : 1
rnn_size : 400
beam_size : 10
dropout : 0.5
max_nl_length : 100
layers : 1
encoder_emb : 400
}
THCudaCheck FAIL file=/tmp/luarocks_cutorch-scm-1-4410/cutorch/lib/THC/generic/THCStorage.cu line=66 error=2 : out of memory
/home/jinyuliu/torch/install/bin/luajit: /home/jinyuliu/torch/install/share/lua/5.1/nn/THNN.lua:110: cuda runtime error (2) : out of memory at /tmp/luarocks_cutorch-scm-1-4410/cutorch/lib/THC/generic/THCStorage.cu:66
stack traceback:
[C]: in function 'v'
/home/jinyuliu/torch/install/share/lua/5.1/nn/THNN.lua:110: in function 'LogSoftMax_updateGradInput'
...e/jinyuliu/torch/install/share/lua/5.1/nn/LogSoftMax.lua:12: in function 'updateGradInput'
...jinyuliu/torch/install/share/lua/5.1/nngraph/gmodule.lua:420: in function 'neteval'
...jinyuliu/torch/install/share/lua/5.1/nngraph/gmodule.lua:454: in function 'updateGradInput'
/home/jinyuliu/torch/install/share/lua/5.1/nn/Module.lua:31: in function 'backward'
./decoder.lua:127: in function 'backward'
main.lua:18: in function 'bp'
main.lua:161: in function 'main'
main.lua:215: in main chunk
[C]: in function 'dofile'
...uliu/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk
[C]: at 0x00405d50
{
beam_size : 10
batch_size : 100
max_code_length : 100
max_nl_length : 100
layers : 1
max_length : 20
rnn_size : 400
}
/home/jinyuliu/torch/install/bin/luajit: cannot open <csharp.encoder> in mode r at /home/jinyuliu/torch/pkg/torch/lib/TH/THDiskFile.c:673
stack traceback:
[C]: at 0x7f927c4c8460
[C]: in function 'DiskFile'
/home/jinyuliu/torch/install/share/lua/5.1/torch/File.lua:405: in function 'load'
predict.lua:215: in function 'main'
predict.lua:251: in main chunk
[C]: in function 'dofile'
...uliu/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk
[C]: at 0x00405d50

You're out of GPU memory. How much GPU memory do you have?

My GPU memory is 2 GB.
How much GPU memory do I need to run this project?

2 gb is too low. I had used a 12GB GPU, but 4GB just might work, depending on the size of the vocabulary.

I got it, thank you very much!

you could try increasing the UNK threshold in buildData to get it to fit in your GPU. Also, try newer pytorch codebases such as opennmt-py with a MeanEncoder and you should have the same model.