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:
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
InferenceEngine::CNNLayerPtr m_layer = (m_network.getLayerByName("reshape2")); Ptr m_ptr = InferenceEngine::Blob::CreateFromData(m_layer->outData); 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?
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*>();
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.
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,