Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Wen__Chengyao
Beginner
149 Views

Layers Output

hi,

Is it possible to get the ouput data(blob) of every layer in the network from cvsdk? I am working on the LPR model which is located in /opt/intel/computer_vision_sdk_2018.1.249/deployment_tools/intel_models/license-plate-recognition-barrier-0001/FP32/license-plate-recognition-barrier-0001.xml

From the deploy file, the "decode" layer gets the output data from "reshape2" layer and produce the printed output of the network, and I was failed  trying to get the output data of "reshape2" layer. Here are the 2 attempts I have tried:

1.

InferRequest::Ptr request;
float* decode_blob = request->GetBlob("decode")->buffer().as<float*>();
float* reshape2_blob = request->GetBlob("reshape2")->buffer().as<float*>();

GetBlob("decode") works well while I got the error 

terminate called after throwing an instance of 'InferenceEngine::details::InferenceEngineException' what(): Cannot find blob with name: reshape2

2.

InferenceEngine::CNNLayerPtr m_layer = (m_network.getLayerByName("reshape2"));
Ptr m_ptr = InferenceEngine::Blob::CreateFromData(m_layer->outData[0]);
float* m_data = m_ptr->buffer().as<float*>();

m_ptr contains the correct information of blobs, like dims() or size(), however when I called buffer().as<float*>(), I got an null pointer.

Is there any thing wrong in my attempts? or Is there any other way to get the output data of layers in the network?

Thanks!

0 Kudos
4 Replies
Monique_J_Intel
Employee
149 Views

Hi Chingyao,

It's possible that in the device plugin that the inference engine is using that layer was fused or taken out. So to see if that's the case lets do a preliminary check. Can you check in your .xml file that the reshape layer actually exist?

There are other ways to get the output data from a layer. If you look in the mask_rcnn sample in R3(I noticed you are on an earlier release so you may want to upgrade) you will see that you can use the following statements:

const auto do_blob = infer_request.GetBlob("layer name");
const auto do_data = do_blob->buffer().as<float*>(); 

Kind Regards,

Monique Jones

chan__allen
Beginner
149 Views

Hi Jones,

I tried your way to get blob out in openvino computer_vision_sdk_2018.3.343, and I confirmed that the blob truly exists in the xml file, but I got the errro:

[ERROR][NOT FOUND] Failed to find input or output with name:'my_reshape'

'my_reshape' is a layer of my net.

Do you know how I can solve this one?

A lot of thanks.

Allenn Chan

Wong__Shane
Beginner
149 Views

I have the same problem.

Is there any limitations while using request.GetBlob("layer name") api?

Shubha_R_Intel
Employee
149 Views

Dear Shane:

Have you tried the full hierarchical name rather than just the last part of the name ? You will be able to see the full hierarchical name in Model Optimizer's resultant IR xml. For instance in this example,

        <layer id="0" name="main/stage_1/conv2d_0/Conv2D" precision="FP16" type="Convolution">  the layer name would actually be: "main/stage_1/conv2d_0/Conv2D" not "conv2D".

Hope this helps and please download the 2019 R1 release of OpenVino which dropped today !

Thanks for using OpenVino,

Shubha