Files
openvino/docs/IE_DG/Graph_debug_capabilities.md
Nikolay Tyukaev ef45b5da8d Doc Migration (master) (#1377)
* Doc Migration from Gitlab (#1289)

* doc migration

* fix

* Update FakeQuantize_1.md

* Update performance_benchmarks.md

* Updates graphs for FPGA

* Update performance_benchmarks.md

* Change DL Workbench structure (#1)

* Changed DL Workbench structure

* Fixed tags

* fixes

* Update ie_docs.xml

* Update performance_benchmarks_faq.md

* Fixes in DL Workbench layout

* Fixes for CVS-31290

* [DL Workbench] Minor correction

* Fix for CVS-30955

* Added nGraph deprecation notice as requested by Zoe

* fix broken links in api doxy layouts

* CVS-31131 fixes

* Additional fixes

* Fixed POT TOC

* Update PAC_Configure.md

PAC DCP 1.2.1 install guide.

* Update inference_engine_intro.md

* fix broken link

* Update opset.md

* fix

* added opset4 to layout

* added new opsets to layout, set labels for them

* Update VisionAcceleratorFPGA_Configure.md

Updated from 2020.3 to 2020.4

Co-authored-by: domi2000 <domi2000@users.noreply.github.com>
2020-07-20 17:36:08 +03:00

2.7 KiB

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:

#include <ngraph/serializer.hpp>

std::shared_ptr<ngraph::Function> 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:

#include <ngraph/pass/visualize_tree.hpp>

std::shared_ptr<ngraph::Function> nGraph;
...
std::vector<std::shared_ptr<ngraph::Function>> 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:

std::shared_ptr<ngraph::Function> 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.