aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/contrib/checkpoint
Commit message (Collapse)AuthorAge
* Expose tf.contrib.checkpoint.PythonStateWrapper.Gravatar A. Unique TensorFlower2018-09-13
| | | | | | | | | | 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
* tf.contrib.checkpoint.NumpyState for saving/restoring NumPy arrays with TF ↵Gravatar Allen Lavoie2018-08-16
| | | | | | | | | | 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
* Add tf.contrib.checkpoint.CheckpointManager for deleting old checkpointsGravatar Allen Lavoie2018-08-13
| | | | | | | | | | 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
* Allows constructing resource variables from tf.Variable.Gravatar Alexandre Passos2018-07-18
| | | | | | | | 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
* Auto tracking for Python lists assigned to attributes of Model/CheckpointableGravatar Allen Lavoie2018-06-29
| | | | | | | | | | | | 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
* Split dependency tracking out from CheckpointableBaseGravatar Allen Lavoie2018-06-22
| | | | | | | | | | 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
* Replace unnecessary `()` in `run_in_graph_and_eager_modes()`.Gravatar Tom Hennigan2018-06-22
| | | | PiperOrigin-RevId: 201652888
* Add tf.contrib.checkpoint.CheckpointableBase for isinstance checks.Gravatar Allen Lavoie2018-06-15
| | | | | | (Also planning to use this in Sonnet) PiperOrigin-RevId: 200797385
* Factor a "capture_dependencies" scope out of Template.Gravatar Allen Lavoie2018-06-14
| | | | | | 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
* Add tf.contrib.checkpoint.list_objects for listing all Python dependencies of aGravatar Allen Lavoie2018-06-14
| | | | | | | | | checkpointable object Useful for asserting that all expected objects have been added as dependencies in a unit test. PiperOrigin-RevId: 200569520
* Make the existing checkpointable data structure a CheckpointableDataStructureGravatar Allen Lavoie2018-05-24
| | | | | | Gives it better/more consistent handling of Layers. PiperOrigin-RevId: 197923880
* Add a checkpointable map data structureGravatar Allen Lavoie2018-05-24
| | | | PiperOrigin-RevId: 197913890
* Add a checkpointable list data structureGravatar Allen Lavoie2018-05-23
| | | | | | | | Allows tracking of Layers and other checkpointable objects by number. Fixes #19250. PiperOrigin-RevId: 197749961
* Move Keras code out of _impl folder and remove API files.Gravatar Pavithra Vijay2018-05-17
| | | | PiperOrigin-RevId: 197097430
* Checkpointable: move python/training/checkpointable_* to ↵Gravatar Allen Lavoie2018-05-16
| | | | | | | | | | 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
* Checkpointable: Add UniqueNameTracker for managing dependencies on ↵Gravatar Allen Lavoie2018-05-11
| | | | | | | | 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
* Checkpointable: A small utility for exempting objects from __setattr__ trackingGravatar Allen Lavoie2018-05-05
| | | | | | | | | | | 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
* Checkpointable: Utilities to read object metadataGravatar Allen Lavoie2018-05-03
| | | | | | Useful for inspecting checkpoints programatically (e.g. in unit tests). PiperOrigin-RevId: 195300780
* Merge changes from github.Gravatar Yifei Feng2018-04-23
| | | | PiperOrigin-RevId: 194031845
* Add a utility to visualize object-based checkpointsGravatar Allen Lavoie2018-04-20
| | | | | | | | 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
* Create a skeleton tf.contrib.checkpoint.Gravatar Allen Lavoie2018-04-19
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