openvino icon indicating copy to clipboard operation
openvino copied to clipboard

can not get the middle layer output data

Open CColten opened this issue 7 years ago • 2 comments

i want to get the output of a middle layer, when i use getLayerByName("xxx"),

but when use GetBolob("xxx")->buffer().as<float *>() , a error occured said that "cannot find blob with name : xxx "

anyone encountered this problem ?

CColten avatar Jun 19 '19 13:06 CColten

I set the output name as 402 and 405: image but when InferenceEngine::Blob::Ptr output_fea_blob = infer_request.GetBlob("402"); Couldn't find 402 Thanks

AbyssGaze avatar Dec 31 '19 03:12 AbyssGaze

You might missmatch CNNNetwork (topological representation of the network) and ExecutableNetwork - the network been loaded to device. CNNNetwork does not have any relation to the real memory. It describe topology in terms of layers and edges between them. And we can assume (that is true) that layer which do not have parents is considered as input and layer which do not have children is treated as output. The executable network, during loading of CNNNetwork is based on this logic, and allow to feed data for input layers and produce data to output. Access to such memory happens through InferRequest::GetBlob/SetBlob. (if you are not familiar with ExecutableNetwork and InferRequest - you can read this page: https://docs.openvinotoolkit.org/latest/_docs_IE_DG_Integrate_with_customer_application_new_API.html

No any other data is accessible because in most cases intermediate data are not required and missing of access allows to perform additional optimizations. In the same time, it might be a requirement to get intermediate data as output (not input because the intermediate data is a result of the previous operations). In this case you have to call CNNNetwork::addOutput(layerName) before calling of Core::LoadNetwork. Been loaded, such network will save intermediate output and will allow to access by InferRequest::SetBlob/GetBlob

elvin-n avatar Jan 01 '20 13:01 elvin-n