Element-Research / rnn

Recurrent Neural Network library for Torch7's nn
BSD 3-Clause "New" or "Revised" License
939 stars 313 forks source link

recursiveCopy got nil in recursiveUtils.lua #386

Closed ghost closed 7 years ago

ghost commented 7 years ago

FastLSTM with MaskZero spit out nil error.

/root/torch/install/bin/luajit: /root/torch/install/share/lua/5.1/rnn/recursiveUtils.lua:44: expecting nested tensors or tables. Got nil and nil instead

aep commented 7 years ago

@deepcoord how did you fix this?

ganeshjawahar commented 7 years ago

--[[ Forward coupling: Copy encoder cell and output to decoder LSTM ]]-- function Seq2Seq:forwardConnect(inputSeqLen) self.decoderLSTM.userPrevOutput = nn.rnn.recursiveCopy(self.decoderLSTM.userPrevOutput, self.encoderLSTM.outputs[inputSeqLen]) self.decoderLSTM.userPrevCell = nn.rnn.recursiveCopy(self.decoderLSTM.userPrevCell, self.encoderLSTM.cells[inputSeqLen]) end

--[[ Backward coupling: Copy decoder gradients to encoder LSTM ]]-- function Seq2Seq:backwardConnect(inputSeqLen) self.encoderLSTM:setGradHiddenState(inputSeqLen, self.decoderLSTM:getGradHiddenState(0)) end

longjiangxue commented 6 years ago

@aep @ganeshjawahar Do your solve this question?