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

Why tf.train.init_from_checkpoint in func model_fn run twice #40

Open
icecity96 opened this issue Mar 24, 2019 · 1 comment
Open

Why tf.train.init_from_checkpoint in func model_fn run twice #40

icecity96 opened this issue Mar 24, 2019 · 1 comment

Comments

@icecity96
Copy link

In function model_fn:

        if init_checkpoint:
            (assignment_map, initialized_variable_names) = modeling.get_assignment_map_from_checkpoint(tvars,init_checkpoint)
            tf.train.init_from_checkpoint(init_checkpoint, assignment_map)
            if use_tpu:
                def tpu_scaffold():
                    tf.train.init_from_checkpoint(init_checkpoint, assignment_map)
                    return tf.train.Scaffold()
                scaffold_fn = tpu_scaffold
            else:
                tf.train.init_from_checkpoint(init_checkpoint, assignment_map)

why tf.train.init_from_checkpoint should run twice?

@xiao2mo
Copy link

xiao2mo commented Apr 9, 2019

The first init op can be omitted. I think the author leave it incautiously.

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