W3cubDocs

/TensorFlow Python

tf.contrib.eager.restore_network_checkpoint

tf.contrib.eager.restore_network_checkpoint(
    network,
    save_path,
    map_func=None
)

Defined in tensorflow/contrib/eager/python/network.py.

Restore the Network from a checkpoint.

If variables have already been created (typically when some or all of the Network is built), they are assigned values from the checkpoint immediately, overwriting any existing values (in graph mode the default session is used for the assignments).

If there are checkpoint entries which do not correspond to any existing variables in the Network, these values are saved for deferred restoration; their initial values will be the checkpointed values once they are created. Requests for multiple deferred restorations behave the same way as immediate restorations, in that later requests will take priority over earlier requests relevant to the same variable.

If this Network shares Layers with another network, those Layers will also have their variables restored from the checkpoint.

Args:

  • network: A Network object to restore.
  • save_path: The return value of tfe.save_network_checkpoint, or a directory to search for a checkpoint.
  • map_func: A function mapping fully qualified variable names (e.g. 'my_network_1/dense_1/kernel') to names in the checkpoint. By default (if map_func=None), the variable prefix for the network being restored (Network.scope_name + '/', e.g. 'my_network_1/') is stripped and all other variable names (shared with other Networks) are left unchanged. Note that this is the same map_func as tfe.save_network_checkpoint, not an inverse mapping.

© 2018 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/python/tf/contrib/eager/restore_network_checkpoint