我是tensorflow的新手,正在尝试运行GNMT(https://github.com/tensorflow/nmt#installing-the-tutorial推断)教程。我的培训没有麻烦,但是在推理过程中遇到了以下断言问题。有人有解决此问题的解决方案吗?
python -m nmt.nmt
--src=de --tgt=en --ckpt=~/Downloads/deen_gnmt_model_4_layer/translate.ckpt \
--hparams_path=nmt/standard_hparams/wmt16_gnmt_4_layer.json \
--out_dir=/tmp/deen_gnmt --vocab_prefix=/tmp/wmt16/vocab.bpe.32000 \
--inference_input_file=/tmp/wmt16/newstest2015.tok.bpe.32000.de \
--infernece_output_file=/tmp/deen_gnmt/output_infer \
--inference_ref_file=/tmp/wmt16/newstest2015.tok.bpe.32000.en \
# Job id 0
# Devices visible to TensorFlow: [_DeviceAttributes(/job:localhost
/replica:0/task:0/device:CPU:0, CPU, 268435456)]
# Loading standard hparams from nmt/standard_hparams /wmt16_gnmt_4_layer.json
# Vocab file /tmp/wmt16/vocab.bpe.32000.de exists
# Vocab file /tmp/wmt16/vocab.bpe.32000.en exists
attention=normed_bahdanau
attention_architecture=gnmt_v2
avg_ckpts=False
batch_size=128
beam_width=10
best_bleu=0
best_bleu_dir=/tmp/deen_gnmt/best_bleu
check_special_token=True
colocate_gradients_with_ops=True
decay_scheme=luong10
dev_prefix=None
dropout=0.2
embed_prefix=None
encoder_type=gnmt
eos=</s>
epoch_step=0
forget_bias=1.0
infer_batch_size=32
infer_mode=greedy
init_op=uniform
init_weight=0.1
language_model=False
learning_rate=1.0
length_penalty_weight=1.0
log_device_placement=False
max_gradient_norm=5.0
max_train=0
metrics=['bleu']
num_buckets=5
num_dec_emb_partitions=0
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/home/n/nmt/nmt/nmt.py", line 703, in <module>
tf.app.run(main=main, argv=[sys.argv[0]] + unparsed)
File "/home/n/.local/lib/python2.7/site-packages/tensorflow/python /platform/app.py", line 125, in run
_sys.exit(main(argv))
File "/home/n/nmt/nmt/nmt.py", line 696, in main
run_main(FLAGS, default_hparams, train_fn, inference_fn)
File "/home/n/nmt/nmt/nmt.py", line 660, in run_main
assert trans_file
AssertionError