# tf.contrib.model_pruning.graph_def_from_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/model_pruning/python/strip_pruning_vars_lib.py#L113-L142) |

Converts checkpoint data to GraphDef.

    tf.contrib.model_pruning.graph_def_from_checkpoint(
        checkpoint_dir, output_node_names
    )

Reads the latest checkpoint data and produces a GraphDef in which the
variables have been converted to constants.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `checkpoint_dir` | Path to the checkpoints. |
| `output_node_names` | List of name strings for the result nodes of the graph. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A GraphDef from the latest checkpoint ||

<br />

<br />

<br />

<br />

| ## Raises ||
|---|---|
| `ValueError` | if no checkpoint is found |

<br />