Open lyy1994 opened 7 years ago
I meet the same problem, hoping for answer
@lyy1994 @hanwei2008 I think this error happens when you have zero length sequence (empty lines) in your inference file.
Yes, @oahziur is correct!! I faced similar issue when running the evaluation (which interrupted the training), and I found that it is caused due to empty lines in my dev files. After removing those zero length sequences
, this issue is resolved.
I run training with "python -m nmt.nmt --attention=scaled_luong --src=ja --tgt=vi --vocab_prefix=/home/ngovinh/nmt/nmt/corpus/vocab --train_prefix=/home/ngovinh/nmt/nmt/corpus/train --dev_prefix=/home/ngovinh/nmt/nmt/corpus/dev --test_prefix=/home/ngovinh/nmt/nmt/corpus/test --out_dir=/data/ngovinh/nmt-attention --src_max_len=80 --tgt_max_len=80 --num_train_steps=12000 --steps_per_stats=100 --num_layers=2 --num_units=128 --dropout=0.2 --metrics=bleu 1" and then I get error after 1000 step as follow: InvalidArgumentError (see above for traceback): assertion failed: [All values in memory_sequence_length must greater than zero.] [Condition x > 0 did not hold element-wise:] [x (IteratorGetNext:1) = ] [25 54 28...]
I have checked all file of data, but they don't have any empty line. I do not know why? can anyone help me? thanks,
@ngovinhtn I presume this error is thrown when an internal evaluation is run on the dev set. There has to be something wrong with your dev
set data. Make sure that they don't have any empty lines in both ja
& vi
files.
@kmario23 thank your reply! My data set surely does not have any empty lines!
I got the same error as above. Indeed my dev
file contains empty lines.
However, this error is thrown only when I try to use an attention model.
When I use configuration
--out_dir=./nmt_attention_model --inference_input_file=./nmt_data/train.vi --inference_output_file=./nmt_model/output_infer --inference_ref_file=./nmt_data/train.en
in Pycharm, I got following error:But it works fine with
--out_dir=./nmt_attention_model --inference_input_file=./nmt_data/tst2013.vi --inference_output_file=./nmt_attention_model/output_infer --inference_ref_file=./nmt_data/tst2013.en
.