Returns `CheckpointReader` for checkpoint found in `ckpt_dir_or_file`. If `ckpt_dir_or_file` resolves to a directory with multiple checkpoints, reader for the latest checkpoint is returned. Args: ckpt_dir_or_file: Directory with checkpoints file or path to checkpoint file. Retur
(ckpt_dir_or_file)
| 46 | |
| 47 | @tf_export("train.load_checkpoint") |
| 48 | def load_checkpoint(ckpt_dir_or_file): |
| 49 | """Returns `CheckpointReader` for checkpoint found in `ckpt_dir_or_file`. |
| 50 | |
| 51 | If `ckpt_dir_or_file` resolves to a directory with multiple checkpoints, |
| 52 | reader for the latest checkpoint is returned. |
| 53 | |
| 54 | Args: |
| 55 | ckpt_dir_or_file: Directory with checkpoints file or path to checkpoint |
| 56 | file. |
| 57 | |
| 58 | Returns: |
| 59 | `CheckpointReader` object. |
| 60 | |
| 61 | Raises: |
| 62 | ValueError: If `ckpt_dir_or_file` resolves to a directory with no |
| 63 | checkpoints. |
| 64 | """ |
| 65 | filename = _get_checkpoint_filename(ckpt_dir_or_file) |
| 66 | if filename is None: |
| 67 | raise ValueError("Couldn't find 'checkpoint' file or checkpoints in " |
| 68 | "given directory %s" % ckpt_dir_or_file) |
| 69 | return pywrap_tensorflow.NewCheckpointReader(filename) |
| 70 | |
| 71 | |
| 72 | @tf_export("train.load_variable") |
no test coverage detected