tensorflow / nmt

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

Problem performing inference using English-Vietnamese model #379

Closed FallakAsad closed 5 years ago

FallakAsad commented 5 years ago

I am trying to perform inference using trained English-Vietnamese model given at NMT documentation at http://download.tensorflow.org/models/nmt/envi_model_1.zip. I am using following command to perform inference using checkpoint provided in the link.

python3 -m nmt.nmt \
    --src=en --tgt=vi \
    --vocab_prefix=nmt/iwslt15/vocab \
    --out_dir=nmt/envi_model_1/ \
    --ckpt=nmt/envi_model_1/translate.ckpt.data-00000-of-00001 \
    --inference_input_file=nmt/iwslt15/tst2012.en \
    --inference_output_file=nmt/output

But I see following error: tensorflow.python.framework.errors_impl.DataLossError: Unable to open table file nmt/envi_model_1/translate.ckpt.data-00000-of-00001: Data loss: not an sstable (bad magic number): perhaps your file is in a different file format and you need to use a different restore operator?

Can you help me out why the command is not working? Am I doing something wrong?

Thanks in advance.

FallakAsad commented 5 years ago

I am closing this issue as there was problem with my command and that was that the --ckpt option must point to the prefix of the model instead of the checkpoint file as "--ckpt=nmt/envi_model_1/translate.ckpt" instead of "--ckpt=nmt/envi_model_1/translate.ckpt.data-00000-of-00001."