Fix hidden initialization #3
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The PyTorch/main.py was throwing the following error:
Traceback (most recent call last):
File "main.py", line 63, in
run_iterations.train_iters()
File "/home/sumanta/Manhattan-LSTM/PyTorch/run_iterations.py", line 58, in train_iters
loss, _ = self.model.train(input_variables, similarity_scores, self.criterion, model_optimizer)
File "/home/sumanta/Manhattan-LSTM/PyTorch/train_network.py", line 32, in train
output_scores = self.manhattan_lstm((sequences_1, sequences_2), hidden).view(-1)
File "/home/sumanta/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 532, in call
result = self.forward(*input, **kwargs)
File "/home/sumanta/Manhattan-LSTM/PyTorch/manhattan_lstm.py", line 42, in forward
outputs_1, hidden_1 = self.lstm_1(embedded_1, hidden)
File "/home/sumanta/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 532, in call
result = self.forward(*input, **kwargs)
File "/home/sumanta/.local/lib/python3.6/site-packages/torch/nn/modules/rnn.py", line 559, in forward
self.dropout, self.training, self.bidirectional, self.batch_first)
TypeError: lstm() received an invalid combination of arguments - got (Tensor, Tensor, list, bool, int, float, bool, bool, bool), but expected one of:
didn't match because some of the arguments have invalid types: (Tensor, Tensor, list, bool, int, float, bool, bool, bool)
didn't match because some of the arguments have invalid types: (Tensor, Tensor, list, bool, int, float, bool, bool, bool)
The root cause was erroneous hidden initialization.