tf.train.CheckpointOptions
Stay organized with collections
Save and categorize content based on your preferences.
Options for constructing a Checkpoint.
tf.train.CheckpointOptions(
experimental_io_device=None
)
Used as the options
argument to either tf.train.Checkpoint.save()
or
tf.train.Checkpoint.restore()
methods to adjust how variables are
saved/restored.
Example: Run IO ops on "localhost" while saving a checkpoint:
step = tf.Variable(0, name="step")
checkpoint = tf.train.Checkpoint(step=step)
options = tf.train.CheckpointOptions(experimental_io_device="/job:localhost")
checkpoint.save("/tmp/ckpt", options=options)
Args |
experimental_io_device
|
string. Applies in a distributed setting.
Tensorflow device to use to access the filesystem. If None (default)
then for each variable the filesystem is accessed from the CPU:0 device
of the host where that variable is assigned. If specified, the
filesystem is instead accessed from that device for all variables.
This is for example useful if you want to save to a local directory,
such as "/tmp" when running in a distributed setting. In that case pass
a device for the host where the "/tmp" directory is accessible.
|
Class Variables |
experimental_io_device
|
Instance of member_descriptor
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.
Last updated 2021-08-16 UTC.
[null,null,["Last updated 2021-08-16 UTC."],[],[],null,["# tf.train.CheckpointOptions\n\n\u003cbr /\u003e\n\n|-----------------------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.6.0/tensorflow/python/training/saving/checkpoint_options.py#L25-L59) |\n\nOptions for constructing a Checkpoint.\n\n#### View aliases\n\n\n**Compat aliases for migration**\n\nSee\n[Migration guide](https://www.tensorflow.org/guide/migrate) for\nmore details.\n\n[`tf.compat.v1.train.CheckpointOptions`](https://www.tensorflow.org/api_docs/python/tf/train/CheckpointOptions)\n\n\u003cbr /\u003e\n\n tf.train.CheckpointOptions(\n experimental_io_device=None\n )\n\nUsed as the `options` argument to either [`tf.train.Checkpoint.save()`](../../tf/train/Checkpoint#save) or\n[`tf.train.Checkpoint.restore()`](../../tf/train/Checkpoint#restore) methods to adjust how variables are\nsaved/restored.\n\nExample: Run IO ops on \"localhost\" while saving a checkpoint: \n\n step = tf.Variable(0, name=\"step\")\n checkpoint = tf.train.Checkpoint(step=step)\n options = tf.train.CheckpointOptions(experimental_io_device=\"/job:localhost\")\n checkpoint.save(\"/tmp/ckpt\", options=options)\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|--------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `experimental_io_device` | string. Applies in a distributed setting. Tensorflow device to use to access the filesystem. If `None` (default) then for each variable the filesystem is accessed from the CPU:0 device of the host where that variable is assigned. If specified, the filesystem is instead accessed from that device for all variables. \u003cbr /\u003e This is for example useful if you want to save to a local directory, such as \"/tmp\" when running in a distributed setting. In that case pass a device for the host where the \"/tmp\" directory is accessible. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Class Variables --------------- ||\n|------------------------|---------------------------------|\n| experimental_io_device | Instance of `member_descriptor` |\n\n\u003cbr /\u003e"]]