tensorflow / nmt

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

The num_encoder_layers is always 2 #329

Closed lingjiew closed 6 years ago

lingjiew commented 6 years ago

I'm trying to train the gnmt model with wmt_gnmt_4_layers.json. The num_layer is set to 4, but the num_encoder_layer and num_decoder_layer is 2, and they should be equal with num_layer, aren't they? Here is part of my printed hparams.

hparams:

src=de tgt=en ... num_decoder_layers=2 num_decoder_residual_layers=0 num_embeddings_partitions=0 num_encoder_layers=2 num_encoder_residual_layers=0 num_gpus=1 num_inter_threads=0 num_intra_threads=0 num_keep_ckpts=5 num_layers=4 num_train_steps=340000 num_translations_per_input=1 num_units=1024 optimizer=sgd out_dir=deen_gnmt_4l_1024u output_attention=True override_loaded_hparams=False pass_hidden_state=True random_seed=None residual=True sampling_temperature=0.0 share_vocab=False ...

luozhouyang commented 6 years ago

The training will save the hparams in the first time you train the model. And if you did not set a new out_dir, it will load the hparams automatically. You can try delete the saved hparams file in $OUT_DIT/hparams and try again.

lingjiew commented 6 years ago

Thank you!