Support saving Python state with object-based checkpoints
authorAllen Lavoie <allenl@google.com>
Wed, 9 May 2018 22:56:43 +0000 (15:56 -0700)
committerTensorFlower Gardener <gardener@tensorflow.org>
Wed, 9 May 2018 22:59:21 +0000 (15:59 -0700)
commitef58a46b730155717f1b03abb20767c1924ad05e
tree6d9509f18b878d07f9e320a566a559c83bac2613
parent22b8b9a528c658144a16dce19ba506561abae2ee
Support saving Python state with object-based checkpoints

Allows SaveableObjects to specify feed dict addition callbacks for object-based saving.

For now just saves get_config() with Layers. Doesn't do any loading, and there isn't quite enough information to reconstruct a Model yet (needs topology).

My plan is to get Models to the point where they can be reconstructed from object-based checkpoints (probably one more change), add in SavedModel export (assuming no dynamic control flow for now), then add this "SavedModel+Python" format to Model.save / load_model.

PiperOrigin-RevId: 196043183
tensorflow/contrib/optimizer_v2/checkpointable_utils_test.py
tensorflow/python/BUILD
tensorflow/python/keras/_impl/keras/engine/saving.py
tensorflow/python/training/checkpointable.py
tensorflow/python/training/checkpointable_utils.py
tensorflow/python/training/checkpointable_utils_test.py
tensorflow/python/training/saver.py
tensorflow/python/util/serialization.py [new file with mode: 0644]
tensorflow/python/util/serialization_test.py [new file with mode: 0644]