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, session=None)
| 1461 | trainable=False)) |
| 1462 | |
| 1463 | def write(self, file_prefix, session=None): |
| 1464 | """Writes a training checkpoint. |
| 1465 | |
| 1466 | The checkpoint includes variables created by this object and any |
| 1467 | trackable objects it depends on at the time `Checkpoint.write()` is |
| 1468 | called. |
| 1469 | |
| 1470 | `write` does not number checkpoints, increment `save_counter`, or update the |
| 1471 | metadata used by `tf.train.latest_checkpoint`. It is primarily intended for |
| 1472 | use by higher level checkpoint management utilities. `save` provides a very |
| 1473 | basic implementation of these features. |
| 1474 | |
| 1475 | Args: |
| 1476 | file_prefix: A prefix to use for the checkpoint filenames |
| 1477 | (/path/to/directory/and_a_prefix). |
| 1478 | session: The session to evaluate variables in. Ignored when executing |
| 1479 | eagerly. If not provided when graph building, the default session is |
| 1480 | used. |
| 1481 | |
| 1482 | Returns: |
| 1483 | The full path to the checkpoint (i.e. `file_prefix`). |
| 1484 | """ |
| 1485 | output = self._saver.save(file_prefix=file_prefix, session=session) |
| 1486 | if tensor_util.is_tensor(output): |
| 1487 | if context.executing_eagerly(): |
| 1488 | return compat.as_str(output.numpy()) |
| 1489 | else: |
| 1490 | # Function building |
| 1491 | return output |
| 1492 | else: |
| 1493 | # Graph + Session, so we already session.ran it. |
| 1494 | return compat.as_str(output) |
| 1495 | |
| 1496 | @property |
| 1497 | def save_counter(self): |
no test coverage detected