Closed ghost closed 5 years ago
As indicated in the error message, have you double-checked pred_src_vocab_size, pred_trg_vocabsize, and all the t2t* parameters? In particular, the following line:
NotFoundError: Key transformer/symbol_modality_30000_512/softmax/weights_0 not found in checkpoint
seems to suggest that your model you are trying to load has been trained with a vocabulary size of 30000. Try to set pred_src_vocab_size and pred_trg_vocab_size to 30000.
I changed pred_src_vocab_size and pred_trg_vocab_size to 30000, and also fixed typo 'tgt' to 'trg', but same errors occurred.
I checked my vocab size:
$ wc -l own_model/model1/vocab.translate_jaen.32768.subwords
36632 own_model/model1/vocab.translate_jaen.32768.subwords
and changed vocab size to 36638, and another error happened.
and changed vocab size to 36638, but another error happened.
I assume that it requires to input the integer IDs of subwords, so I encoded the sentences to the subword IDs. Finally, I got this:
2019-09-26 23:53:14,645 INFO: Next sentence (ID: 1): 29244 29593 29983 29948 11978 13215 18019 24558 26 85 1521 21484 22202 26 89 48 1395 1921 27611 8348 63 5107 2325 31
2019-09-26 23:53:15.547951: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library libcublas.so.10.0
2019-09-26 23:53:17,282 INFO: Decoded (ID: 1): 7790 80 6397 11115 26 5218 28 29 8590 71 2293 32 122 4732 4144 557 5509 225 91 72 22672 74 38 17183 27
2019-09-26 23:53:17,282 INFO: Stats (ID: 1): score=-7.478206 num_expansions=100 time=2.64
It seems to work. Thank you so much!
Yes, SGNMT expects integer IDs by default, but it also supports text format - see the wmap, preprocessing, and postprocessing options.
I ran this command:
and mymodel.ini is this:
but it doesn't load my model.
Could you please tell me how to fix them?