karpathy / char-rnn

Multi-layer Recurrent Neural Networks (LSTM, GRU, RNN) for character-level language models in Torch
11.58k stars 2.58k forks source link

luajit: Out of memory #80

Open mfcabrera opened 9 years ago

mfcabrera commented 9 years ago

I am running char-rnn (with a somewhat wild input dataset) and I get not enough memory. My input file is 17GB text file and I have server (no GPU only CPU) with 128 GB of RAM.

The command line parameters I used:

th train.lua -data_dir data/big_file -rnn_size 512 -num_layers 2 -dropout 0.5

Should I make the -rnn_parameter smaller? Should I use a smaller file? What's the recommended size if any.

I have to say I am new to Lua/Torch so I might be doing something wrong.

soumith commented 9 years ago

you could install torch with plain lua, (not luajit) and you wont run into such memory issues. luajit has a heap limit of 2GB in lua-land.

To install plain lua:

git clone https://github.com/torch/distro.git ~/torch --recursive
cd ~/torch; 
TORCH_LUA_VERSION=LUA51 ./install.sh
ghost commented 9 years ago

@mfcabrera Does Luajit run out of memory when reading the data file? If so, using the latest build could help, through this PR: https://github.com/karpathy/char-rnn/pull/74

Thanks @soumith, didn't know torch can be installed with plain Lua!