Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support nGraph API #15537

Merged
merged 2 commits into from
Dec 2, 2019
Merged

Support nGraph API #15537

merged 2 commits into from
Dec 2, 2019

Conversation

l-bat
Copy link
Contributor

@l-bat l-bat commented Sep 18, 2019

Support new Inference Engine API.
Problem layers:

  • LRN (problem DNNTestNetwork.Inception_5h, Test_ONNX_nets.ZFNet)
  • Deconvolution (only works 2D without bias)

Failed nets:
✔️ DNNTestNetwork.MobileNet_SSD_Caffe_Different_Width_Height (bad norm)
✔️ DNNTestNetwork.OpenFace (bad norm) support Power
✔️ Test_Caffe_nets.FasterRCNN_zf (Proposal bug)
✔️ Test_TensorFlow_nets.opencv_face_detector_uint8 (blob not found) -> bad norm
✔️ Test_TensorFlow_nets.EAST_text_detection (maxpool incorrect shape + incorrect net) -> bad norm (support Power)
⁉️ Test_Torch_nets.FastNeuralStyle_accuracy (DLDT)
🔻 Test_Torch_nets.ENet_accuracy (bad norm)
✔️ Test_Torch_nets.OpenFace_accuracy (bad norm) support Power
❌ TEST_P(Test_Darknet_nets_async, Accuracy) (layer = nullptr sigseg Region doesn't supported)
After fuse:
✔️ Test_ONNX_nets.DenseNet121 (blob not found)
✔️ Test_Darknet_nets.YOLOv3 ( bad norm - DLDT)

✔️ Deconv3D fixed #15572
✔️ Eltwise with coeffs
✔️ Pooling (default ceil TF)
✔️ Scale (BatchNorm)

Link with IE nGraph:
🔻 Test_Caffe_nets.FasterRCNN_vgg16
✔️ Test_TensorFlow_nets.Faster_RCNN (topK DetectionOutput)

force_builders=Custom,Custom Win,Custom Mac
build_image:Custom=ubuntu-openvino-2019r3.0:16.04
build_image:Custom Win=openvino-2019r3.0
build_image:Custom Mac=openvino-2019r3.0

test_modules:Custom=dnn,python2,python3,java
test_modules:Custom Win=dnn,python2,python3,java
test_modules:Custom Mac=dnn,python2,python3,java

buildworker:Custom=linux-1
test_opencl:Custom=OFF
test_bigdata:Custom=1
test_filter:Custom=*

CMakeLists.txt Outdated
@@ -1595,19 +1595,22 @@ endif()

if(WITH_INF_ENGINE OR INF_ENGINE_TARGET)
if(INF_ENGINE_TARGET)
list(GET INF_ENGINE_TARGET 0 ie_target)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is these changes here? They should be on the 3.4 branch already: #15376

Please rebase patch.

Copy link
Member

@dkurt dkurt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@l-bat, These changes looks very promising to make IE backend more stable. I think we can now completely merge DNN_BACKEND_INFERENCE_ENGINE and DNN_BACKEND_NGRAPH implementations.

modules/dnn/src/dnn.cpp Outdated Show resolved Hide resolved

#ifdef HAVE_DNN_NGRAPH
return initNgraph(nodes);
#endif // HAVE_DNN_NGRAPH
InferenceEngine::Builder::Layer ieLayer = InferenceEngine::Builder::ScaleShiftLayer(name);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How this can work without runtime check?
Please run tests locally.

InferenceEngine::CNNNetReader reader;
reader.ReadNetwork(xml);
reader.ReadWeights(bin);

InferenceEngine::CNNNetwork ieNet = reader.getNetwork();
#else
InferenceEngine::Core& ie = getCore();
InferenceEngine::CNNNetwork ieNet = ie.ReadNetwork(xml, bin);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dkurt Please review this part of code.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@l-bat, Can we keep ReadNetwork and ReadWeights for now? I think it'd be more stable considering coming #16015.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can, but CNNNetReader is almost deprecated.

Comment on lines 217 to 218
if (cnn.getPrecision() != InferenceEngine::Precision::FP16 && targetId == DNN_TARGET_MYRIAD)
resetMyriadDevice();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it here?

if (!equal_flag)
{
InferenceEngine::CNNNetwork curr_t_net(t_net);
curr_t_net.reshape(inShapes);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is ".get()" method with "const" logical modifier doing some network reshaping?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like a workaround introduced at #13608 to dynamically reshape networks from OpenVINO's IRs in case of different input shape.

Copy link
Member

@dkurt dkurt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@dkurt dkurt self-assigned this Dec 2, 2019
@alalek alalek merged commit 7523c77 into opencv:3.4 Dec 2, 2019
@alalek alalek mentioned this pull request Dec 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants