Open mlm22222 opened 2 years ago
IndexError: tensors used as indices must be long, byte or bool tensors
建议debug下
是用的win么?我也遇到了,应该是索引的问题,但是在linux就没报错
把 beams_order = best_scores_id.squeeze(1) / n_extended_vocab 改成 beams_order = best_scores_id.squeeze(1) // n_extended_vocab
Traceback (most recent call last): File "D:/Text-Summarizer-Pytorch-Chinese-master/eval.py", line 171, in
eval_processor.evaluate_batch(True)
File "D:/Text-Summarizer-Pytorch-Chinese-master/eval.py", line 78, in evaluate_batch
start_id, end_id, unk_id)
File "D:\Text-Summarizer-Pytorch-Chinese-master\beam_search.py", line 179, in beam_search
sum_temporal_srcs_i, prev_s_i).type(T.long)
File "D:\Text-Summarizer-Pytorch-Chinese-master\beam_search.py", line 54, in advance
self.hid_h = h[beams_order] #(beam, n_hid); sorted
IndexError: tensors used as indices must be long, byte or bool tensors