Skip to content

error when run train.py #4

@rndn123

Description

@rndn123

I got this error in your GitHub code please help thanks in advance
Traceback (most recent call last):
File "train.py", line 305, in
sys.exit(main(sys.argv[1:]))
File "train.py", line 300, in main
train(opt, shared, m, optim, ema, train_data, val_data)
File "train.py", line 178, in train
train_perf, extra_train_perf, loss, num_ex = train_epoch(opt, shared, m, optim, ema, train_data, i, train_idx)
File "train.py", line 113, in train_epoch
output = m.forward(wv_idx1, wv_idx2, cv_idx1, cv_idx2)
File "/content/drive/My Drive/layer_augmentation-master/layer_augmentation-master/pipeline.py", line 104, in forward
att1, att2 = self.attention(input_enc1, input_enc2)
File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 550, in call
result = self.forward(*input, **kwargs)
File "./attention/local_attention.py", line 36, in forward
self.shared.att_soft1, self.shared.att_soft2)
File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 550, in call
result = self.forward(*input, **kwargs)
File "/content/drive/My Drive/layer_augmentation-master/layer_augmentation-master/within_layer.py", line 86, in forward
datt1_ls.append(layer(att1.transpose(1,2)).transpose(1,2).contiguous().view(1, batch_l, sent_l1, sent_l2))
File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 550, in call
result = self.forward(*input, **kwargs)
File "./constraint/n1.py", line 57, in forward
d = self.logic(att)
File "./constraint/n1.py", line 37, in logic
p_content_selector = get_p_selector(self.opt, self.shared, 'content_word', with_nul=False).view(self.shared.batch_l, 1, self.shared.sent_l1)
File "./constraint/constr_utils.py", line 58, in get_p_selector
mask[ex][p_contents] = 1.0
IndexError: index 15 is out of bounds for dimension 0 with size 14

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions