Skip to content
This repository was archived by the owner on Jul 7, 2023. It is now read-only.

How does t2t-decoder use specified checkpoint ? #476

Closed
efeiefei opened this issue Dec 14, 2017 · 8 comments
Closed

How does t2t-decoder use specified checkpoint ? #476

efeiefei opened this issue Dec 14, 2017 · 8 comments

Comments

@efeiefei
Copy link

I want to evaluate all checkponts' real bleu with t2t-decoder and standard bleu script.
It would be convenient if you supported specifying checkpoint.

Thx

@martinpopel
Copy link
Contributor

martinpopel commented Dec 14, 2017

I did a PR adding a --checkpoint_path option to t2t-decoder. It has been merged, but then someone reverted it.

You may be interested in my scripts t2t-bleu and t2t-translate-all. I plan to do a PR after cleaning those a bit.

@efeiefei
Copy link
Author

@martinpopel
Thanks a lot. Looking forward to your PR.

@rsepassi
Copy link
Contributor

One way you can do this is by copying the checkpoint you want evaluated into a directory and then setting --output_dir to that folder.

@martinpopel
Copy link
Contributor

@efeiefei: My PR is finally done: #488

@SkyAndCloud
Copy link
Contributor

@martinpopel
Hi, thanks for your PR. However, I found that t2t-decoder didn't use specified checkpoint(oppositely the newest checkpoint) to inference even if I use --checkpoint_path. My env:

tensorflow:1.4.1
tensor2tensor:1.5.5

Now I can only use --output_dir to inference while I want to test an earlier checkpoint. I know an alternative method is to edit checkpoint file in output_dir, but things shouldn't behave like this after your PR. I didn't find some related change log in commit messages after your PR. Please give me some tips! Thank you.

@martinpopel
Copy link
Contributor

--checkpoint_path works for me, thanks to https://github.com/tensorflow/tensor2tensor/blob/master/tensor2tensor/bin/t2t_decoder.py#L89.
It works only with decode_from_file. It does not work with decode_interactive and score_file (although it could; if you need it, send a PR, I would say).

@SkyAndCloud
Copy link
Contributor

@martinpopel Thank you for your help, I have sent a PR which enables checkpoint_path arg in interactive decoding.

@SkyAndCloud
Copy link
Contributor

My PR was merged, look #694

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants