| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
|
|
|
| |
This makes it possible to checkpoint arbitrary python state if it can be
serialized to a string.
Also updates NumpyState to accept np.int32, np.int64, np.float32, np.float64
types.
PiperOrigin-RevId: 212879609
|
|
|
|
|
|
|
|
|
|
| |
checkpoints
A bit of extra infrastructure in checkpointable restore (save was already done) to support Python callbacks.
The same strategy should work for any Python state, although it's confined to non-pickled NumPy arrays at the moment.
PiperOrigin-RevId: 209085928
|
|
|
|
|
|
|
|
|
|
| |
Removes a bit of boilerplate from training loops (making a prefix from a directory).
Also clarifies the recovery of checkpoint lists (like tf.train.Saver.recover_last_checkpoints, but automatic and more thorough). Adds a couple fields to the CheckpointState proto to support this.
Should live in contrib until I make it work well with tf.keras.Model.save_weights. When used together, save_weights needs to number its checkpoints. (There's a TODO for this.)
PiperOrigin-RevId: 208566198
|
|
|
|
|
|
|
|
| |
Also adds arguments to control distributed aggregation to the tf.Variable constructor.
Removes tfe.Variable from examples as it's now unnecessary.
PiperOrigin-RevId: 205096552
|
|
|
|
|
|
|
|
|
|
|
|
| |
Conceptually lists just get replaced with a list-like wrapper. A shallow copy is maintained for error checking (since appends to it aren't monitored, we can't do restore-on-create for variables unless it's being modified through the wrapper).
There are lots of other details. I gave up on generalizing our isinstance(obj, (list, tuple)) checks and just subclassed list. Behaving like a list means the type should be unhashable, which requires some workarounds when we're collecting objects (object-identity collections, and object-identity versions of weak reference containers).
Adds a decorator for exempting whole methods from automatic dependency tracking so we don't need to track down every last self.inputs = [] statement to avoid polluting dependencies.
There's a TODO for tuples and dictionaries.
PiperOrigin-RevId: 202703271
|
|
|
|
|
|
|
|
|
|
| |
Some unit test fiddling, but otherwise just moving code around.
My goal is to be able to use checkpointable data structures (or something like them) in Checkpointable's __setattr__ override. Checkpointable data structures depend on Layer, so Checkpointable and CheckpointableBase need to be in seprate files (so we can have the dependency chain CheckpointableBase->Layer->CheckpointableDataStructure->Checkpointable).
This will also require changes to python/keras/engine/__init__.py (which currently requires Network and Layer be imported together), but I'll do that in a separate change.
PiperOrigin-RevId: 201712549
|
|
|
|
| |
PiperOrigin-RevId: 201652888
|
|
|
|
|
|
| |
(Also planning to use this in Sonnet)
PiperOrigin-RevId: 200797385
|
|
|
|
|
|
| |
I don't intend for this to get used much directly, but it's handy for Template-like frameworks (e.g. Sonnet), to let them re-enter the dependency-capturing part of Templates.
PiperOrigin-RevId: 200595624
|
|
|
|
|
|
|
|
|
| |
checkpointable object
Useful for asserting that all expected objects have been added as dependencies
in a unit test.
PiperOrigin-RevId: 200569520
|
|
|
|
|
|
| |
Gives it better/more consistent handling of Layers.
PiperOrigin-RevId: 197923880
|
|
|
|
| |
PiperOrigin-RevId: 197913890
|
|
|
|
|
|
|
|
| |
Allows tracking of Layers and other checkpointable objects by number.
Fixes #19250.
PiperOrigin-RevId: 197749961
|
|
|
|
| |
PiperOrigin-RevId: 197097430
|
|
|
|
|
|
|
|
|
|
| |
python/training/checkpointable/
Need to add some new checkpointable files in core (specifically I had some checkpointable data structures in mind), and prefixing more files with "checkpointable_" in python/training/ seems dirty.
No functional changes, just some branching and build/import fiddling.
PiperOrigin-RevId: 196883136
|
|
|
|
|
|
|
|
| |
arbitrarily named objects
Makes generating object-unique dependency names easier, which will hopefully discourage people from using Graph-global names with Checkpointable.
PiperOrigin-RevId: 196311633
|
|
|
|
|
|
|
|
|
|
|
| |
Exposes it as tf.contrib.checkpoint.NoDependency. Objects wrapped in a
NoDependency object get unwrapped in __setattr__ and not tracked.
Removes the _save_counter dependency from tf.train.Checkpoint (the save counter
is still tracked as "save_counter" and always has been, so this is a
backwards-compatible dependency removal).
PiperOrigin-RevId: 195502562
|
|
|
|
|
|
| |
Useful for inspecting checkpoints programatically (e.g. in unit tests).
PiperOrigin-RevId: 195300780
|
|
|
|
| |
PiperOrigin-RevId: 194031845
|
|
|
|
|
|
|
|
| |
Useful for generating a warm fuzzy feeling that everything you think should be saved was saved, and for explaining what object-based checkpointing is. (Also useful on the former front will be a planned "assert that all of this Graph's trainable variables are accessible from object X" function.)
Somewhat hacky since it generates strings rather than using the pydot bindings (and so works without a pydot dependency).
PiperOrigin-RevId: 193708003
|
|
My plan for this is to incubate tools for working with object-based checkpoints:
- Tools for managing dependency graphs, e.g. checkpointable lists/dictionaries
- Inspecting/visualizing checkpoints
- Listing variables and gathering initializers from a Checkpointable object
and its dependencies
- Verifying all variables are accessible as dependencies, which should make
converting existing graph building Saver uses easier/safer.
This CL includes none of those things, it just moves the split_dependency tool
here instead of contrib/eager.
PiperOrigin-RevId: 193531292
|