You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add support for reading and writing TensorFlow SavedModel files to and from the GraphDef Editor's Graph class. See https://www.tensorflow.org/guide/extend/model_files for a description of the file format.
This support will involve giving the Graph additional fields to support the portions of SavedModel that are not already modeled in Graph -- notably the "signatures" for invoking the model in TensorFlow Serving.
Add regression tests that use the tf.Saver APIs to create temporary SavedModel files (see the Save and Restore guide for more information).
Add an example script in the examples folder that generates a SavedModel file, rewrites it into a second SavedModel file, then loads the second file into a TensorFlow graph and performs some inference.
The text was updated successfully, but these errors were encountered:
TensorFlow's APIs for reading and writing variable checkpoints are surprisingly Byzantine. Basically, the only supported way to touch those checkpoint files is through special ops that are only accessible via the tf.Saver class.
For the initial implementation of SavedModel support I'll put heavy restrictions on checkpointed variables. Specifically:
If the user creates a graph_def_editor.Graph directly from a tf.Graph, then:
Disallow the existence of save/restore ops in the graph. That is, we will raise an exception if any ops of the "Save", "SaveV2", "Restore", or "RestoreV2" variety are found in the graph.
When writing a SavedModel file, create an empty dummy TensorFlow graph and point a Saver at that graph, i.e.
dummy_graph = tf.Graph()
with dummy_graph.as_default():
saver = tf.train.Saver(allow_empty=True)
with tf.Session() as sess:
saver.save(sess, save_path=_EXPORT_DIR, write_meta_graph=False,
write_state=False)
If the user creates a graph_def_editor.Graph from a SavedModel "file", then:
Disallow modifications to variables in the graph (i.e. adding, removing, changing type, etc.)
Keep a pointer to the checkpoint file/directory in the original SavedModel
When writing the new SavedModel, copy the checkpoint info from the old one
Add support for reading and writing TensorFlow SavedModel files to and from the GraphDef Editor's
Graph
class. See https://www.tensorflow.org/guide/extend/model_files for a description of the file format.This support will involve giving the
Graph
additional fields to support the portions of SavedModel that are not already modeled inGraph
-- notably the "signatures" for invoking the model in TensorFlow Serving.Add regression tests that use the
tf.Saver
APIs to create temporary SavedModel files (see the Save and Restore guide for more information).Add an example script in the
examples
folder that generates a SavedModel file, rewrites it into a second SavedModel file, then loads the second file into a TensorFlow graph and performs some inference.The text was updated successfully, but these errors were encountered: