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

IndexError: list index out of range #8

Open
BattsetsegB opened this issue Oct 28, 2018 · 0 comments
Open

IndexError: list index out of range #8

BattsetsegB opened this issue Oct 28, 2018 · 0 comments

Comments

@BattsetsegB
Copy link

BattsetsegB commented Oct 28, 2018

zhen@zhen-Lenovo:~/pytorch-dual-learning$ ./train-dual.sh
Namespace(alpha=0.01, cuda=False, dict=['data/groups/chatbot/dl_data/lm/dict.en.pkl', 'data/groups/chatbot/dl_data/lm/dict.de.pkl'], lm=['data/groups/chatbot/dl_data/lm/wmt16-en.pt', 'data/groups/chatbot/dl_data/lm/wmt16-de.pt'], log_every=5, model=['modelA', 'modelB'], nmt=['data/groups/chatbot/dl_data/wmt16-small/model.wmt16-ende-small.best.bin', 'data/groups/chatbot/dl_data/wmt16-small/model.wmt16-deen-small.best.bin'], save_n_iter=400, src=['data/groups/chatbot/dl_data/wmt16-dual/train-small.en', 'data/groups/chatbot/dl_data/wmt16-dual/train-small.de'], start_iter=0)
loading pieces, part A
load modelA from [data/groups/chatbot/dl_data/wmt16-small/model.wmt16-ende-small.best.bin]
load train_srcA from [data/groups/chatbot/dl_data/wmt16-dual/train-small.en]
load lmA from [data/groups/chatbot/dl_data/lm/wmt16-en.pt]
/home/zhen/.local/lib/python3.6/site-packages/torch/serialization.py:316: SourceChangeWarning: source code of class 'model.RNNModel' has changed. you can retrieve the original source code by accessing the object's source attribute or set torch.nn.Module.dump_patches = True and use the patch tool to revert the changes.
warnings.warn(msg, SourceChangeWarning)
/home/zhen/.local/lib/python3.6/site-packages/torch/serialization.py:316: SourceChangeWarning: source code of class 'torch.nn.modules.dropout.Dropout' has changed. you can retrieve the original source code by accessing the object's source attribute or set torch.nn.Module.dump_patches = True and use the patch tool to revert the changes.
warnings.warn(msg, SourceChangeWarning)
/home/zhen/.local/lib/python3.6/site-packages/torch/serialization.py:316: SourceChangeWarning: source code of class 'torch.nn.modules.sparse.Embedding' has changed. you can retrieve the original source code by accessing the object's source attribute or set torch.nn.Module.dump_patches = True and use the patch tool to revert the changes.
warnings.warn(msg, SourceChangeWarning)
/home/zhen/.local/lib/python3.6/site-packages/torch/serialization.py:316: SourceChangeWarning: source code of class 'torch.nn.modules.rnn.LSTM' has changed. you can retrieve the original source code by accessing the object's source attribute or set torch.nn.Module.dump_patches = True and use the patch tool to revert the changes.
warnings.warn(msg, SourceChangeWarning)
/home/zhen/.local/lib/python3.6/site-packages/torch/serialization.py:316: SourceChangeWarning: source code of class 'torch.nn.modules.linear.Linear' has changed. you can retrieve the original source code by accessing the object's source attribute or set torch.nn.Module.dump_patches = True and use the patch tool to revert the changes.
warnings.warn(msg, SourceChangeWarning)
loading pieces, part B
load modelB from [data/groups/chatbot/dl_data/wmt16-small/model.wmt16-deen-small.best.bin]
load train_srcB from [data/groups/chatbot/dl_data/wmt16-dual/train-small.de]
load lmB from [data/groups/chatbot/dl_data/lm/wmt16-de.pt]

start of epoch 1
/home/zhen/pytorch-dual-learning/nmt/model.py:490: UserWarning: Implicit dimension choice for softmax has been deprecated. Change the call to include dim=X as an argument.
att_weight = F.softmax(att_weight)
/home/zhen/pytorch-dual-learning/nmt/model.py:400: UserWarning: Implicit dimension choice for log_softmax has been deprecated. Change the call to include dim=X as an argument.
p_t = F.log_softmax(score_t)
Traceback (most recent call last):
File "dual.py", line 197, in
dual(args)
File "dual.py", line 123, in dual
lm_probs.append(lmB.get_prob(smid))
File "/home/zhen/pytorch-dual-learning/lm/lm_prob.py", line 34, in get_prob
output, hidden = self.model(input, hidden)
File "/home/zhen/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 325, in call
result = self.forward(*input, **kwargs)
File "/home/zhen/pytorch-dual-learning/model.py", line 39, in forward
output, hidden = self.rnn(emb, hidden)
File "/home/zhen/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 325, in call
result = self.forward(*input, **kwargs)
File "/home/zhen/.local/lib/python3.6/site-packages/torch/nn/modules/rnn.py", line 169, in forward
output, hidden = func(input, self.all_weights, hx)
File "/home/zhen/.local/lib/python3.6/site-packages/torch/nn/_functions/rnn.py", line 385, in forward
return func(input, *fargs, **fkwargs)
File "/home/zhen/.local/lib/python3.6/site-packages/torch/nn/_functions/rnn.py", line 245, in forward
nexth, output = func(input, hidden, weight)
File "/home/zhen/.local/lib/python3.6/site-packages/torch/nn/_functions/rnn.py", line 85, in forward
hy, output = inner(input, hidden[l], weight[l])
IndexError: list index out of range

@BattsetsegB BattsetsegB changed the title KeyError: tensor(3) IndexError: list index out of range Dec 4, 2018
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