# tf.contrib.eager.restore_network_checkpoint

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/contrib/eager/python/network.py#L970-L1027) |

Restore the Network from a checkpoint. (deprecated)

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

> [!WARNING]
> **Warning:** THIS FUNCTION IS DEPRECATED. It will be removed in a future version. Instructions for updating: Please inherit from tf.keras.Model instead of tfe.Network, and use tf.keras.Model.load_weights.

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 `Layer`s with another network, those `Layer`s will
also have their variables restored from the checkpoint.

<br />

<br />

<br />

| ## 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. |

<br />