-
Notifications
You must be signed in to change notification settings - Fork 2k
Filed to run GNMT #5
Comments
Thanks, I will need to update the |
I am also adding instructions on how to train and load the gnmt model from scratch. |
I ran a standard attention / scaled_luong / uni system and go the expected results. |
@vince62s Did you check with the standard_hparams for GNMT, there are also pre-trained models available for download in the README page. |
Same problem here. After training, when doing inference I get:
It only works when I delete all these keys from the hparams file, and when I set the --hparams_path to the directory of the best_bleu, but then after one run, for some reason, it rewrites the hparams file, and add these problematic key/values again... It's not clear how this mechanism works. My guess is that when the code is saving hparams, it simply writes key values that it doesn't suppose to. |
@NadavB can you share the command getting the error? were you using the standard_hparams file in the repo for inference? There are some updates to the hparams recently, so I think the standard_hparams maybe out of date. |
@oahziur I did not use the standard hparams. I used the params as shown in the tutorial. So for training:
And for inference:
|
@NadavB Hello. i"m studying nmt. how to command your script?? please let me know basiclly |
@LimWoohyun Look at https://github.com/tensorflow/nmt -> search for "Hands-on – building an attention-based NMT model" the command is written there. |
@oahziur I get Key error using the standard_hparams (tf 1.6rc1, will try on my other machine with tf1.5-cuda).
using the command:
full output here: https://gist.github.com/bquast/30ba7630d2bf32b59dd8349889fc7638 EDIT: confirmed, same error on tf15.-cuda https://gist.github.com/bquast/0ddbf8eda363d312dd57b51aebb11f5d |
@bquast I recently got the error using the same configuration.
I tried this with tf14 too, but no luck. Are there any updates on this? Thank you. |
hey, no news yet, any progress on your side? |
@bquast @tiberiu92 @oahziur python -m nmt.nmt \
--src=de --tgt=en \
--ckpt=/home/xiaohao/nmt/models/deen_gnmt_model_4_layer/translate.ckpt \
--hparams_path=nmt/standard_hparams/wmt16_gnmt_4_layer.json \
--out_dir=/home/xiaohao/data/deen_gnmt \
--vocab_prefix=/home/xiaohao/data/wmt16/vocab.bpe.32000 \
--inference_input_file=/home/xiaohao/data/wmt16/newstest2015.tok.bpe.32000.de \
--inference_output_file=/home/xiaohao/data/deen_gnmt/output_infer \
--inference_ref_file=/home/xiaohao/data/wmt16/newstest2015.tok.bpe.32000.en NotFoundError (see above for traceback): Key dynamic_seq2seq/encoder/rnn/basic_lstm_cell/bias not found in checkpoint I print keys of xiaohao@ubuntu:~/nmt$ python ckpt_print.py models/deen_gnmt_model_4_layer/translate.ckpt
('CHECKPOINT_FILE: ', 'models/deen_gnmt_model_4_layer/translate.ckpt')
('tensor_name: ', 'embeddings/encoder/embedding_encoder')
('tensor_name: ', 'dynamic_seq2seq/decoder/memory_layer/kernel')
('tensor_name: ', 'dynamic_seq2seq/decoder/multi_rnn_cell/cell_3/basic_lstm_cell/kernel')
('tensor_name: ', 'dynamic_seq2seq/encoder/bidirectional_rnn/fw/basic_lstm_cell/kernel')
('tensor_name: ', 'dynamic_seq2seq/decoder/multi_rnn_cell/cell_3/basic_lstm_cell/bias')
('tensor_name: ', 'dynamic_seq2seq/decoder/output_projection/kernel')
('tensor_name: ', 'dynamic_seq2seq/decoder/multi_rnn_cell/cell_0_attention/attention/bahdanau_attention/query_layer/kernel')
('tensor_name: ', 'dynamic_seq2seq/decoder/multi_rnn_cell/cell_0_attention/attention/basic_lstm_cell/kernel')
('tensor_name: ', 'dynamic_seq2seq/encoder/rnn/multi_rnn_cell/cell_0/basic_lstm_cell/kernel')
('tensor_name: ', 'dynamic_seq2seq/decoder/multi_rnn_cell/cell_1/basic_lstm_cell/kernel')
('tensor_name: ', 'dynamic_seq2seq/decoder/multi_rnn_cell/cell_0_attention/attention/bahdanau_attention/attention_v')
('tensor_name: ', 'dynamic_seq2seq/encoder/rnn/multi_rnn_cell/cell_0/basic_lstm_cell/bias')
('tensor_name: ', 'dynamic_seq2seq/decoder/multi_rnn_cell/cell_0_attention/attention/bahdanau_attention/attention_b')
('tensor_name: ', 'dynamic_seq2seq/decoder/multi_rnn_cell/cell_0_attention/attention/bahdanau_attention/attention_g')
('tensor_name: ', 'dynamic_seq2seq/decoder/multi_rnn_cell/cell_1/basic_lstm_cell/bias')
('tensor_name: ', 'Variable')
('tensor_name: ', 'dynamic_seq2seq/decoder/multi_rnn_cell/cell_0_attention/attention/basic_lstm_cell/bias')
('tensor_name: ', 'embeddings/decoder/embedding_decoder')
('tensor_name: ', 'dynamic_seq2seq/decoder/multi_rnn_cell/cell_2/basic_lstm_cell/bias')
('tensor_name: ', 'dynamic_seq2seq/encoder/rnn/multi_rnn_cell/cell_1/basic_lstm_cell/bias')
('tensor_name: ', 'dynamic_seq2seq/encoder/bidirectional_rnn/bw/basic_lstm_cell/kernel')
('tensor_name: ', 'dynamic_seq2seq/encoder/bidirectional_rnn/bw/basic_lstm_cell/bias')
('tensor_name: ', 'dynamic_seq2seq/encoder/rnn/multi_rnn_cell/cell_2/basic_lstm_cell/kernel')
('tensor_name: ', 'dynamic_seq2seq/encoder/bidirectional_rnn/fw/basic_lstm_cell/bias')
('tensor_name: ', 'dynamic_seq2seq/encoder/rnn/multi_rnn_cell/cell_2/basic_lstm_cell/bias')
('tensor_name: ', 'dynamic_seq2seq/decoder/multi_rnn_cell/cell_2/basic_lstm_cell/kernel')
('tensor_name: ', 'dynamic_seq2seq/encoder/rnn/multi_rnn_cell/cell_1/basic_lstm_cell/kernel')
xiaohao@ubuntu:~/nmt$ I try the PR(#265), and tks~ @oahziur |
It complains a key error
"KeyError: num_residual_layers"
Here is my script
python -m nmt.nmt
--src=en --tgt=de
--vocab_prefix=${DATA_DIR}/vocab
--train_prefix=${DATA_DIR}/train
--dev_prefix=${DATA_DIR}/newstest2014
--test_prefix=${DATA_DIR}/newstest2015
--out_dir=$(OUT_DIR}/test
--hparams_path nmt/standard_hparams/wmt16_en_de_gnmt.json
The text was updated successfully, but these errors were encountered: