Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About the evaluation method for the selector. #27

Open
ZhichaoOuyang opened this issue Mar 8, 2020 · 2 comments
Open

About the evaluation method for the selector. #27

ZhichaoOuyang opened this issue Mar 8, 2020 · 2 comments

Comments

@ZhichaoOuyang
Copy link

Why is the model restored in each evaluation on the selector the model saved in the last iteration? So how to choose the best model in training?

@ZhichaoOuyang
Copy link
Author

in util.py:
def load_ckpt(saver, sess, ckpt_dir='train', ckpt_path=None):
"""Load checkpoint from the train directory and restore it to saver and sess, waiting 10 secs in the case of failure. Also returns checkpoint name."""
ckpt_dir = os.path.join(FLAGS.log_root, ckpt_dir)
while True:
try:
if not ckpt_path:
latest_filename = "checkpoint_best" if "eval" in ckpt_dir else None
ckpt_state = tf.train.get_checkpoint_state(ckpt_dir, latest_filename=latest_filename)
ckpt_path = ckpt_state.model_checkpoint_path
tf.logging.info('Loading checkpoint %s', ckpt_path)

The last two line means always load the last iteration model?

@HsuWanTing
Copy link
Owner

Yes, if you don't give a pretrained model path, it will use the latest checkpoint as default.

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

No branches or pull requests

2 participants