tensor2tensor icon indicating copy to clipboard operation
tensor2tensor copied to clipboard

still use the latest model when t2t-decoder used checkpoint_path

Open annisamansa opened this issue 8 years ago • 7 comments

my command line is like this:

t2t-decoder --t2t_usr_dir=/disk1/xx/longman_data --output_dir=/disk1/xx/longman_data/model --data_dir=/disk1/xx/longman_data --problems=translate_my_c2_e --decode_hparams="beam_size=5,alpha=0.6" --model=transformer --hparams_set=translate_my_c2e_hparams --checkpoint_path=/disk1/xx/longman_data/model/model.ckpt-6000 --decode_from_file=/disk1/xx/longman_data/eval/longman_src --decode_to_file=/disk1/xx/longman_data/eval/longman.tgt

but still use the latest ckpt when decoding... is there something wrong with my command?

thanks a lot..

annisamansa avatar Feb 01 '18 08:02 annisamansa

my package version are: tensor2tensor (1.4.2) tensorflow-gpu (1.4.1)

annisamansa avatar Feb 01 '18 08:02 annisamansa

my model ckpt files:

-rw-r--r-- 1 caina kaiwoo 19298468 Feb 1 01:10 model.ckpt-4000.meta -rw-r--r-- 1 caina kaiwoo 24 Feb 1 02:56 model.ckpt-4001.data-00000-of-00002 -rw-r--r-- 1 caina kaiwoo 3845160968 Feb 1 02:56 model.ckpt-4001.data-00001-of-00002 -rw-r--r-- 1 caina kaiwoo 34580 Feb 1 02:56 model.ckpt-4001.index -rw-r--r-- 1 caina kaiwoo 19298466 Feb 1 02:56 model.ckpt-4001.meta -rw-r--r-- 1 caina kaiwoo 24 Feb 1 05:16 model.ckpt-6000.data-00000-of-00002 -rw-r--r-- 1 caina kaiwoo 3845160968 Feb 1 05:16 model.ckpt-6000.data-00001-of-00002 -rw-r--r-- 1 caina kaiwoo 34580 Feb 1 05:16 model.ckpt-6000.index -rw-r--r-- 1 caina kaiwoo 19298466 Feb 1 05:16 model.ckpt-6000.meta -rw-r--r-- 1 caina kaiwoo 24 Feb 1 07:03 model.ckpt-6001.data-00000-of-00002 -rw-r--r-- 1 caina kaiwoo 3845160968 Feb 1 07:03 model.ckpt-6001.data-00001-of-00002 -rw-r--r-- 1 caina kaiwoo 34580 Feb 1 07:03 model.ckpt-6001.index -rw-r--r-- 1 caina kaiwoo 19298468 Feb 1 07:03 model.ckpt-6001.meta -rw-r--r-- 1 caina kaiwoo 24 Feb 1 09:23 model.ckpt-8000.data-00000-of-00002 -rw-r--r-- 1 caina kaiwoo 3845160968 Feb 1 09:23 model.ckpt-8000.data-00001-of-00002 -rw-r--r-- 1 caina kaiwoo 34580 Feb 1 09:23 model.ckpt-8000.index -rw-r--r-- 1 caina kaiwoo 19298468 Feb 1 09:23 model.ckpt-8000.meta

annisamansa avatar Feb 01 '18 08:02 annisamansa

This should be fixed in https://github.com/tensorflow/tensor2tensor/pull/524/commits/bb3c8e6286033ac9ae818b0d3b6679630d5fcab4 which is already merged in the GitHub master, but not released on PyPI yet (will be in v1.4.3, I guess).

martinpopel avatar Feb 01 '18 08:02 martinpopel

replied so fast..moving~~~

and also t2t-translate-all bug (maybe also be merged though):

INFO:tensorflow:Found 19 files with steps: 1, 2000, 2001, 4000, 4001, 6000, 6001, 8000, 8001, 10001, 12001, 14001, 16001, 18001, 20001, 22001, 24001, 26001, 28001 INFO:tensorflow:Translating /disk1/xx/longman_data/model/model.ckpt-1 INFO:tensorflow:Translating /disk1/xx/longman_data/eval/translate_youdao_c2_e-1 Traceback (most recent call last): File "/usr/bin/t2t-translate-all", line 17, in tf.app.run() File "/usr/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 48, in run _sys.exit(main(_sys.argv[:1] + flags_passthrough)) File "/usr/bin/t2t-translate-all", line 12, in main t2t_translate_all.main(argv) File "/usr/lib/python2.7/site-packages/tensor2tensor/bin/t2t_translate_all.py", line 99, in main ).format(**locals()) KeyError: 'FLAGS'

annisamansa avatar Feb 01 '18 08:02 annisamansa

Yes, this bug is also fixed and merged in https://github.com/tensorflow/tensor2tensor/pull/524/commits/c4a6549bbcab6ce57daa9a909b1d5f5d48fc876f

martinpopel avatar Feb 01 '18 08:02 martinpopel

yes, u are right.. when i used t2t_decoder.py, the problem solved. thank u~~:)

annisamansa avatar Feb 01 '18 09:02 annisamansa

@annisamansa: These fixes are not released in v1.4.3. If it works for you, can you please close this issue?

martinpopel avatar Feb 03 '18 10:02 martinpopel