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

Checkpoint restoration for VAEGAN needs to account for global step #82

Open
indraastra opened this issue Jul 30, 2017 · 0 comments
Open

Comments

@indraastra
Copy link
Contributor

The VAEGAN training code saves checkpoints using the value of the global training step, which results in checkpoints with names like 'vaegan.ckpt-800.index', for example. Any code that looks for an existing checkpoint also needs to account for this naming scheme, but the existence check used doesn't quite work with this scheme:

if os.path.exists(ckpt_name + '.index') or os.path.exists(ckpt_name):

I would suggest changing the check to something like this:

    latest_checkpoint = tf.train.latest_checkpoint(os.path.dirname(ckpt_name))
    if latest_checkpoint:
        saver.restore(sess, latest_checkpoint)
        print("Model restored from checkpoint {}.".format(latest_checkpoint))
    else:
        print("Model checkpoint not found.")

(This won't quite work if checkpoints from multiple models are created in the same directory, since it relies on the presence of a file named 'checkpoint'.)

@indraastra indraastra changed the title Checkpoint restoration needs to be updated Checkpoint restoration for VAEGAN needs to account for global step Jul 30, 2017
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

1 participant