Traceback (most recent call last):


 "translate.py", line 129, in <module>

main()


 "translate.py", line 70, in main

= translator.translate(batch, data)


 "/home/qzw123/wangyuan/OpenNMT-py-master/onmt/Translator.py", line 206, in translate

pred, predScore, attn, goldScore = self.translateBatch(batch, data)


 "/home/qzw123/wangyuan/OpenNMT-py-master/onmt/Translator.py", line 153, in translateBatch

inp, context, decStates, context_lengths=context_lengths)


 "/root/anaconda2/lib/python2.7/site-packages/torch/nn/modules/module.py", line 206, in __call__

result = self.forward(*input, **kwargs)


 "/home/qzw123/wangyuan/OpenNMT-py-master/onmt/Models.py", line 176, in forward

input, context, state, context_lengths=context_lengths)


 "/home/qzw123/wangyuan/OpenNMT-py-master/onmt/Models.py", line 347, in _run_forward_pass

context_lengths=context_lengths)


 "/root/anaconda2/lib/python2.7/site-packages/torch/nn/modules/module.py", line 206, in __call__

result = self.forward(*input, **kwargs)


 "/home/qzw123/wangyuan/OpenNMT-py-master/onmt/modules/GlobalAttention.py", line 138, in forward

mask = sequence_mask(context_lengths)


 "/home/qzw123/wangyuan/OpenNMT-py-master/onmt/Utils.py", line 23, in sequence_mask

.lt(lengths.unsqueeze(1)))
RuntimeError: inconsistent tensor size at /opt/conda/conda-bld/pytorch_1501972792122/work/pytorch-0.1.12/torch/lib/TH/generic/THTensorMath.c:2675**

| epoch 001:
0%|
| 0/156 [00:00<?, ?it/s]Traceback (most recent call last):


 "train.py", line 343, in <module>

cli_main()


 "train.py", line 339, in cli_main

main(args)


 "train.py", line 92, in main

train(args, trainer, task, epoch_itr)


 "train.py", line 133, in train

log_output = trainer.train_step(samples)


 "/home/user/Desktop/mosharaf/bitbucket/benchmarks_negation/benchmarks_negation/code/external/fairseq/fairseq/trainer.py", line 342, in train_step

raise e


 "/home/user/Desktop/mosharaf/bitbucket/benchmarks_negation/benchmarks_negation/code/external/fairseq/fairseq/trainer.py", line 306, in train_step

ignore_grad


 "/home/user/Desktop/mosharaf/bitbucket/benchmarks_negation/benchmarks_negation/code/external/fairseq/fairseq/tasks/fairseq_task.py", line 246, in train_step

loss, sample_size, logging_output = criterion(model, sample)


 "/home/user/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 547, in __call__

result = self.forward(*input, **kwargs)


 "/home/user/Desktop/mosharaf/bitbucket/benchmarks_negation/benchmarks_negation/code/external/fairseq/fairseq/criterions/sentence_prediction.py", line 41, in forward

classification_head_name='sentence_classification_head',


 "/home/user/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 547, in __call__

result = self.forward(*input, **kwargs)


 "/home/user/Desktop/mosharaf/bitbucket/benchmarks_negation/benchmarks_negation/code/external/fairseq/fairseq/models/roberta/model.py", line 99, in forward

x, extra = self.decoder(src_tokens, features_only, return_all_hiddens, **kwargs)


 "/home/user/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 547, in __call__

result = self.forward(*input, **kwargs)


 "/home/user/Desktop/mosharaf/bitbucket/benchmarks_negation/benchmarks_negation/code/external/fairseq/fairseq/models/roberta/model.py", line 287, in forward

x, extra = self.extract_features(src_tokens, return_all_hiddens)


 "/home/user/Desktop/mosharaf/bitbucket/benchmarks_negation/benchmarks_negation/code/external/fairseq/fairseq/models/roberta/model.py", line 295, in extract_features

last_state_only=not return_all_hiddens,


 "/home/user/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 547, in __call__

result = self.forward(*input, **kwargs)


 "/home/user/Desktop/mosharaf/bitbucket/benchmarks_negation/benchmarks_negation/code/external/fairseq/fairseq/modules/transformer_sentence_encoder.py", line 183, in forward

x = self.embed_tokens(tokens)


 "/home/user/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 547, in __call__

result = self.forward(*input, **kwargs)


 "/home/user/.local/lib/python3.6/site-packages/torch/nn/modules/sparse.py", line 114, in forward

self.norm_type, self.scale_grad_by_freq, self.sparse)


 "/home/user/.local/lib/python3.6/site-packages/torch/nn/functional.py", line 1467, in embedding

return torch.embedding(weight, input, padding_idx, scale_grad_by_freq, sparse)
RuntimeError: _th_index_select not supported on CPUType for Half
