[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-04-26 UTC."],[],[],null,["# tf.compat.v1.GraphDef\n\n\u003cbr /\u003e\n\n|----------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.16.1/tensorflow/core/framework/graph.proto) |\n\nA protobuf containing the graph of operations.\n\n\u003cbr /\u003e\n\nMigrate to TF2\n--------------\n\n\u003cbr /\u003e\n\n| **Caution:** This API was designed for TensorFlow v1. Continue reading for details on how to migrate from this API to a native TensorFlow v2 equivalent. See the [TensorFlow v1 to TensorFlow v2 migration guide](https://www.tensorflow.org/guide/migrate) for instructions on how to migrate the rest of your code.\n\nThis API is not available in TensorFlow 2.x.\n\nYou should not need to use `GraphDef`s directly in TF2. To load `GraphDef`s in\nTF2, use SavedModel. The SavedModel contains the `GraphDef`.\n\nBefore: \n\n with tf.io.gfile.GFile('/tmp/graph.pb', 'rb') as f:\n graph_def = tf.compat.v1.GraphDef()\n graph_def.ParseFromString(f.read())\n\nAfter: \n\n tf.saved_model.load('/tmp/saved_model')\n\nIf you would like to create a `GraphDef` in TF2, use [`tf.function`](../../../tf/function) and\n`get_concrete_function`. \n\n @tf.function\n def f(x):\n return x\n\n graph_def = f.get_concrete_function(1.).graph.as_graph_def()\n print(graph_def)\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nDescription\n-----------\n\n### Used in the notebooks\n\n| Used in the guide |\n|----------------------------------------------------------------------------------------|\n| - [Migrating your TFLite code to TF2](https://www.tensorflow.org/guide/migrate/tflite) |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Attributes ---------- ||\n|--------------|------------------------------|\n| `debug_info` | `GraphDebugInfo debug_info` |\n| `library` | `FunctionDefLibrary library` |\n| `node` | `repeated NodeDef node` |\n| `version` | `int32 version` |\n| `versions` | `VersionDef versions` |\n\n\u003cbr /\u003e"]]