torch / nn

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FastLSTM out of memory error

tastyminerals opened this issue · comments

commented

Training a simple recurrent network with 200 hidden units using nn.RecGRU module works without issues. However, once I replace nn.RecGRU with nn.FastLSTM I am getting the following error:

Epoch #1	
training...	
THCudaCheck FAIL file=/home/pavel/torch/extra/cutorch/lib/THC/generic/THCStorage.cu line=66 error=2 : out of memory
/home/pavel/torch/install/bin/luajit: /home/pavel/torch/install/share/lua/5.1/nn/Container.lua:67: 
In 4 module of nn.Sequential:
In 1 module of nn.Sequential:
/home/pavel/torch/install/share/lua/5.1/torch/File.lua:351: cuda runtime error (2) : out of memory at /home/pavel/torch/extra/cutorch/lib/THC/generic/THCStorage.cu:66

Obviously this cannot be simply due to lack of GPU memory because I have 12GB and the network itself is small.

Basically all I change is the following line:
local rnn = nn.RecGRU(opt.inputsize, opt.hiddensize[1])
with
local rnn = nn.FastLSTM(opt.inputsize, opt.hiddensize[1], nil, nil, nil, true, opt.dropout/2)