yoonkim / lstm-char-cnn

LSTM language model with CNN over characters
MIT License
826 stars 221 forks source link

wrong number of arguments for function call in THNN.lua #23

Closed tastyminerals closed 8 years ago

tastyminerals commented 8 years ago

Attempting to run your code results in the following error:

using CUDA on GPU 0...  
loading data files...   
Word vocab size: 97117, Char vocab size: 163    
reshaping tensors...    
data load done. Number of batches in train: 711, val: 64, test: 1   
Word vocab size: 97117, Char vocab size: 163, Max word length (incl. padding):  59  
creating an LSTM-CNN with 2 layers  
number of parameters in the model: 50060817 
cloning rnn 
cloning criterion   
/local/pavels/torch/install/bin/luajit: /local/pavels/torch/install/share/lua/5.1/nn/THNN.lua:109: wrong number of arguments for function call
stack traceback:
    [C]: in function 'v'
    /local/pavels/torch/install/share/lua/5.1/nn/THNN.lua:109: in function 'Threshold_updateGradInput'
    /local/pavels/torch/install/share/lua/5.1/nn/Threshold.lua:32: in function 'updateGradInput'
    ...l/pavels/torch/install/share/lua/5.1/nngraph/gmodule.lua:420: in function 'neteval'
    ...l/pavels/torch/install/share/lua/5.1/nngraph/gmodule.lua:454: in function 'updateGradInput'
    ...l/pavels/torch/install/share/lua/5.1/nngraph/gmodule.lua:420: in function 'neteval'
    ...l/pavels/torch/install/share/lua/5.1/nngraph/gmodule.lua:454: in function 'updateGradInput'
    /local/pavels/torch/install/share/lua/5.1/nn/Module.lua:31: in function 'backward'
    lstm-char-cnn/main.lua:331: in function 'feval'
    lstm-char-cnn/main.lua:381: in main chunk
    [C]: in function 'dofile'
    ...vels/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
    [C]: at 0x00405d70

command used:

./th lstm-char-cnn/main.lua -data_dir lstm-char-cnn/data/ru -savefile ru-char-small -rnn_size 300 -use_chars 0 -use_words 1 -word_vec_size 200 -highway_layers 1 -kernels '{1,2,3,4,5,6}' -feature_maps '{25,50,75,100,125,150}' -EOS '' -gpuid 0 > charlstm.log 2>&1 &
gonzalolc commented 8 years ago

how did you solved this? I Have a similar error

tastyminerals commented 8 years ago

Updated nn and cunn.