NMT_GAN icon indicating copy to clipboard operation
NMT_GAN copied to clipboard

list index out of range

Open SunXiaoqian1 opened this issue 5 years ago • 2 comments

When using a dictionary generated by BPE-processed data, the following error occurred, but there is no problem when using a dictionary generated from data that has not been processed by BPE, how should I modify it?

Traceback (most recent call last): File "train.py", line 83, in train(config) File "train.py", line 18, in train du.load_vocab() File "/home/sxq/NMT_GAN-master/utils.py", line 56, in load_vocab self.src2idx, self.idx2src = load_vocab_(self.config.src_vocab, self.config.src_vocab_size) File "/home/sxq/NMT_GAN-master/utils.py", line 43, in load_vocab_ vocab = [line.split()[0] for line in codecs.open(path, 'r', 'utf-8')] IndexError: list index out of range

Looking forward to your reply.

SunXiaoqian1 avatar May 11 '19 10:05 SunXiaoqian1

When using a dictionary generated by BPE-processed data, the following error occurred, but there is no problem when using a dictionary generated from data that has not been processed by BPE, how should I modify it?

Traceback (most recent call last): File "train.py", line 83, in train(config) File "train.py", line 18, in train du.load_vocab() File "/home/sxq/NMT_GAN-master/utils.py", line 56, in load_vocab self.src2idx, self.idx2src = load_vocab_(self.config.src_vocab, self.config.src_vocab_size) File "/home/sxq/NMT_GAN-master/utils.py", line 43, in load_vocab_ vocab = [line.split()[0] for line in codecs.open(path, 'r', 'utf-8')] IndexError: list index out of range

Looking forward to your reply.

Sorry to bother you,I want to know how you got those BPE-processed datas,by Sennrich‘s subword-nmt?If so,how do you map the generated files to the file paths in these yamls? For example,I have no idea how this file named “target.bpe.txt.vocab.34432” came from. I would appreciate to receive your reply.

swordlin avatar Nov 28 '19 08:11 swordlin

同问。。。。

BOBOWEI2 avatar Nov 22 '21 08:11 BOBOWEI2