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

module_file = tf.train.latest_checkpoint()的参数 #15

Open
zjp1907 opened this issue Jan 9, 2018 · 1 comment
Open

module_file = tf.train.latest_checkpoint()的参数 #15

zjp1907 opened this issue Jan 9, 2018 · 1 comment

Comments

@zjp1907
Copy link

zjp1907 commented Jan 9, 2018

module_file = tf.train.latest_checkpoint()
示例中怎么没有参数,无法运行。。。
这个方法的定义是:
def latest_checkpoint(checkpoint_dir, latest_filename=None):
"""Finds the filename of latest saved checkpoint file.

Args:
checkpoint_dir: Directory where the variables were saved.
latest_filename: Optional name for the protocol buffer file that
contains the list of most recent checkpoint filenames.
See the corresponding argument to Saver.save().

Returns:
The full path to the latest checkpoint or None if no checkpoint was found.
"""

Pick the latest checkpoint based on checkpoint state.

ckpt = get_checkpoint_state(checkpoint_dir, latest_filename)
if ckpt and ckpt.model_checkpoint_path:
# Look for either a V2 path or a V1 path, with priority for V2.
v2_path = _prefix_to_checkpoint_path(ckpt.model_checkpoint_path,
saver_pb2.SaverDef.V2)
v1_path = _prefix_to_checkpoint_path(ckpt.model_checkpoint_path,
saver_pb2.SaverDef.V1)
if file_io.get_matching_files(v2_path) or file_io.get_matching_files(
v1_path):
return ckpt.model_checkpoint_path
else:
logging.error("Couldn't match files for checkpoint %s",
ckpt.model_checkpoint_path)
return None

@std-in
Copy link

std-in commented Jan 23, 2018

any path is ok

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