sherjilozair / char-rnn-tensorflow

Multi-layer Recurrent Neural Networks (LSTM, RNN) for character-level language models in Python using Tensorflow
MIT License
2.64k stars 960 forks source link

W tensorflow/core/framework/op_kernel.cc:909] Resource exhausted:OOM when allocating tensor with shape[1250,25670] #52

Closed PratikshaTaneja closed 7 years ago

PratikshaTaneja commented 7 years ago

I am getting error while running train.py Traceback (most recent call last): file "train.py", line 111,in main() File "train.py", line 48, in main train(args) File "train.py", line 98, in train trainloss, state, = sess.run([model.cost,model.final_state,model.train_op],feed) File "usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 372, in run run_metadata_ptr) File "usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 636, in _run feed_dict_string,options,run_metadata)

sherjilozair commented 7 years ago

How big is your RAM? Are you running this on your own datasets? Are you using default hyperparameters or did you change them?

Thanks.

PratikshaTaneja commented 7 years ago

i have 4 GB RAM. i am using default datasets and hyperparameters and i have not changed anything. i am using tensorflow 0.9.0 on ubuntu 14.04

ubergarm commented 7 years ago

I've had Out Of Memory issues using my video card which has 8GiB RAM if I increase the model parameters too much.

@PratikshaTaneja did you try a smaller model e.g.

python train.py --rnn_size 64 \
                        --num_layers 1 \
                        --seq_length 16

If you're still having problems using the latest version of this repo, feel free to open a new issue. Thanks for reporting on your experience!