restorer¶
Primitive Restorer, can be used standalone.
Classes
Restorer |
Restorer provide a way to restore objects from tf.train.Checkpoint . |
-
class
ashpy.restorers.restorer.
Restorer
(logdir='log', ckpts_dir='ckpts', expect_partial=True)[source]¶ Bases:
object
Restorer
provide a way to restore objects fromtf.train.Checkpoint
.Can be standalone.
-
__init__
(logdir='log', ckpts_dir='ckpts', expect_partial=True)[source]¶ Initialize the Restorer.
Parameters: Return type: None
-
_restore_checkpoint
(checkpoint, partial=True)[source]¶ Restore or initialize the persistence layer (checkpoint).
-
restore_callback
(callback, callback_ckpt_id)[source]¶ Return the restored callbacks.
Return type: List
[Callback
]
-
restore_object
(placeholder, object_ckpt_id)[source]¶ Restore a placeholder from a checkpoint using the specified id.
Warning
When restoring a
tf.keras.Model
object from checkpoint assure that the model has been correctly built and instantiated by firstly calling it on some sample inputs. In the case of a model built with either the Sequential or Functional API an exception will be raised; for a model built with the Chainer API it will fail silently, restoration will be “successful” but no values will actually be restored since there are no valid placeholder as the model has not be built yet.TODO: Args TODO: Example
-