Skip to content

different ways and usage of save and restore trained models using tensorflow

Notifications You must be signed in to change notification settings

moontree/tensorflow_save_and_restore_models

Repository files navigation

Tensorflow_Save_And_Restore_Models

Different ways and usage of save and restore trained models using tensorflow

There are several different ways of dumping a TensorFlow graph into a file and then loading it into another program, this project provides clear examples/information on how they work:

  • The checkpoint files (produced e.g. by calling saver.save() on a tf.train.Saver object) contain only the weights, and any other variables defined in the same program. To use them in another program, you must re-create the associated graph structure (e.g. by running code to build it again, or calling tf.import_graph_def()), which tells TensorFlow what to do with those weights. Note that calling saver.save() also produces a file containing a MetaGraphDef, which contains a graph and details of how to associate the weights from a checkpoint with that graph. See the tutorial for more details.*
  • Freeze the graph to save the graph and weights together using freeze_graph. A frozen graph can be loaded using tf.import_graph_def()(This file may be not found in your tensorflow, you can save it to your project). In this case, the weights are (typically) embedded in the graph, so you don't need to load a separate checkpoint.

Different Ways to Use Frozen Features In Transfer Learning

Refrences:

About

different ways and usage of save and restore trained models using tensorflow

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages