Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Train with error #79

Open
wilddylan opened this issue Jul 20, 2017 · 2 comments
Open

Train with error #79

wilddylan opened this issue Jul 20, 2017 · 2 comments

Comments

@wilddylan
Copy link

When I execute this command th train.lua --dataset 20000 --hiddenSize 100; I got this error:

-- Loading dataset
Loading vocabulary from data/vocab.t7 ...

Dataset stats:
  Vocabulary size: 3830
         Examples: 58852
dgk ending

-- Epoch 1 / 30

/Users/root1/torch/install/bin/lua: ...root1/torch/install/share/lua/5.2/rnn/recursiveUtils.lua:44: expecting nested tensors or tables. Got nil and nil instead
stack traceback:
	[C]: in function 'error'
	...root1/torch/install/share/lua/5.2/rnn/recursiveUtils.lua:44: in function 'recursiveCopy'
	./seq2seq.lua:58: in function 'backwardConnect'
	./seq2seq.lua:78: in function 'train'
	train.lua:90: in main chunk
	[C]: in function 'dofile'
	...oot1/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk
	[C]: in ?

Before execute this command, I install nn, rnn and async use luarock.

@wilddylan
Copy link
Author

wilddylan commented Jul 20, 2017

Fixed

Modified seq2seq.lua:

--[[ Backward coupling: Copy decoder gradients to encoder LSTM ]]--
function Seq2Seq:backwardConnect()
  -- self.encoderLSTM.userNextGradCell =--
  --   nn.rnn.recursiveCopy(self.encoderLSTM.userNextGradCell, self.decoderLSTM.userGradPrevCell)
  -- self.encoderLSTM.gradPrevOutput =
  --   nn.rnn.recursiveCopy(self.encoderLSTM.gradPrevOutput, self.decoderLSTM.userGradPrevOutput)
  if (self.encoderLSTM.userNextGradCell ~= nil) then
    self.encoderLSTM.userNextGradCell =
    nn.rnn.recursiveCopy(self.encoderLSTM.userNextGradCell, self.decoderLSTM.userGradPrevCell)
  end
  if (self.encoderLSTM.gradPrevOutput ~= nil) then
    self.encoderLSTM.gradPrevOutput =
    nn.rnn.recursiveCopy(self.encoderLSTM.gradPrevOutput, self.decoderLSTM.userGradPrevOutput)
  end
end

@wilddylan
Copy link
Author

But When training continued, Got this error:

-- Loading dataset
Loading vocabulary from data/vocab.t7 ...

Dataset stats:
  Vocabulary size: 3830
         Examples: 58852
dgk ending

-- Epoch 1 / 30

/Users/root1/torch/install/bin/lua: /Users/root1/torch/install/share/lua/5.2/torch/File.lua:375: unknown object
stack traceback:
	[C]: in function 'error'
	/Users/root1/torch/install/share/lua/5.2/torch/File.lua:375: in function 'readObject'
	./dataset.lua:144: in function 'for iterator'
	train.lua:77: in main chunk
	[C]: in function 'dofile'
	...oot1/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk
	[C]: in ?

How to Fix this???

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant