pytorch-dual-learning icon indicating copy to clipboard operation
pytorch-dual-learning copied to clipboard

IndexError: list index out of range

Open BattsetsegB opened this issue 5 years ago • 0 comments

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 avatar Oct 28 '18 08:10 BattsetsegB