# Graph Debug Capabilities {#openvino_docs_IE_DG_Graph_debug_capabilities} Inference Engine supports two different objects for a graph representation: the nGraph function and CNNNetwork. Both representations provide an API to get detailed information about the graph structure. ## nGraph Function To receive additional messages about applied graph modifications, rebuild the nGraph library with the `-DNGRAPH_DEBUG_ENABLE=ON` option. To enable serialization and deserialization of the nGraph function to a JSON file, rebuild the nGraph library with the `-DNGRAPH_JSON_ENABLE=ON` option. To serialize or deserialize the nGraph function, call the nGraph function as follows: ```cpp #include std::shared_ptr nGraph; ... ngraph::serialize("test_json.json", nGraph); // For graph serialization std::ifstream file("test_json.json"); // Open a JSON file nGraph = ngraph::deserialize(file); // For graph deserialization ``` To visualize the nGraph function to the xDot format or to an image file, use the `ngraph::pass::VisualizeTree` graph transformation pass: ```cpp #include std::shared_ptr nGraph; ... std::vector> g2{nGraph}; ngraph::pass::VisualizeTree("after.png").run_on_module(g2); // Visualize the nGraph function to an image ``` ## CNNNetwork To serialize the CNNNetwork to the Inference Engine Intermediate Representation (IR) format, use the `CNNNetwork::serialize(...)` method: ```cpp std::shared_ptr nGraph; ... CNNNetwork network(nGraph); network.serialize("test_ir.xml", "test_ir.bin"); ``` > **NOTE**: CNNNetwork created from the nGraph function might differ from the original nGraph > function because the Inference Engine applies some graph transformation. ## Deprecation Notice
Deprecation Begins June 1, 2020
Removal Date December 1, 2020
*Starting with the OpenVINO™ toolkit 2020.2 release, all of the features previously available through nGraph have been merged into the OpenVINO™ toolkit. As a result, all the features previously available through ONNX RT Execution Provider for nGraph have been merged with ONNX RT Execution Provider for OpenVINO™ toolkit.* *Therefore, ONNX RT Execution Provider for nGraph will be deprecated starting June 1, 2020 and will be completely removed on December 1, 2020. Users are recommended to migrate to the ONNX RT Execution Provider for OpenVINO™ toolkit as the unified solution for all AI inferencing on Intel® hardware.*