tensorflow / nmt

TensorFlow Neural Machine Translation Tutorial
Apache License 2.0
6.37k stars 1.96k forks source link

FailedPreconditionError HashTable has different value for same key. Key <s> has 1 and trying to add value 4 #147

Closed SuperYm closed 6 years ago

SuperYm commented 6 years ago

the code from example: nmt/scripts/wmt16_en_de.sh /tmp/wmt16 python -m nmt.nmt \ --src=de --tgt=en \ --hparams_path=nmt/standard_hparams/wmt16_gnmt_4_layer.json \ --out_dir=/tmp/deen_gnmt \ --vocab_prefix=/tmp/wmt16/vocab.bpe.32000 \ --train_prefix=/tmp/wmt16/train.tok.clean.bpe.32000 \ --dev_prefix=/tmp/wmt16/newstest2013.tok.bpe.32000 \ --test_prefix=/tmp/wmt16/newstest2015.tok.bpe.32000 it caused error like this: FailedPreconditionError (see above for traceback): HashTable has different value for same key. Key has 1 and trying to add value 4 [[Node: string_to_index/hash_table/table_init = InitializeTableFromTextFileV2[delimiter="\t", key_index=-2, value_index=-1, vocab_size=-1, _device="/job:localhost/replica:0/task:0/device:CPU:0"](string_to_index/hash_table, string_to_index/hash_table/table_init/asset_filepath)]] [[Node: string_to_index/hash_table/table_init/_10 = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device_incarnation=1, tensor_name="edge_6_string_to_index/hash_table/table_init", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:GPU:0"]()]] what makes this happen?how can i slove it?could someone help?

KaqiKaqi commented 6 years ago

I have the same problem. Could you please tell me how you fixed this?

SuperYm commented 6 years ago

check the vocab file ,maybe contains two same values like ,delete one.