Writes a training checkpoint. The checkpoint includes variables created by this object and any trackable objects it depends on at the time `Checkpoint.write()` is called. `write` does not number checkpoints, increment `save_counter`, or update the metadata used by `tf.train.lat
(self, file_prefix)
| 1798 | trainable=False)) |
| 1799 | |
| 1800 | def write(self, file_prefix): |
| 1801 | """Writes a training checkpoint. |
| 1802 | |
| 1803 | The checkpoint includes variables created by this object and any |
| 1804 | trackable objects it depends on at the time `Checkpoint.write()` is |
| 1805 | called. |
| 1806 | |
| 1807 | `write` does not number checkpoints, increment `save_counter`, or update the |
| 1808 | metadata used by `tf.train.latest_checkpoint`. It is primarily intended for |
| 1809 | use by higher level checkpoint management utilities. `save` provides a very |
| 1810 | basic implementation of these features. |
| 1811 | |
| 1812 | Args: |
| 1813 | file_prefix: A prefix to use for the checkpoint filenames |
| 1814 | (/path/to/directory/and_a_prefix). |
| 1815 | |
| 1816 | Returns: |
| 1817 | The full path to the checkpoint (i.e. `file_prefix`). |
| 1818 | """ |
| 1819 | output = self._saver.save(file_prefix=file_prefix) |
| 1820 | if tensor_util.is_tensor(output): |
| 1821 | if context.executing_eagerly(): |
| 1822 | return compat.as_str(output.numpy()) |
| 1823 | else: |
| 1824 | # Function building |
| 1825 | return output |
| 1826 | else: |
| 1827 | # Graph + Session, so we already session.ran it. |
| 1828 | return compat.as_str(output) |
| 1829 | |
| 1830 | @property |
| 1831 | def save_counter(self): |