Search code examples
c++deep-learningneural-networkopenvino

How to extend dims of blob in openvino


Hello from a beginner of OpenVINO. In the official tutorial, the optimal way of taking input for a cascade of networks is

auto output = infer_request1.GetBlob(output_name);
infer_request2.SetBlob(input_name, output);

However, in my case, the output's layout is CHW but the next network's input has an NCHW layout. So how could I reshape, or extend the dims of output effectively? Or is there any better way to feed blob to the next model in my case?

I tried input_info->setLayout(Layout::CHW);, which is taken from openvino's hello_classification example, but it didn't do the job (I think I misunderstood this function).


Solution

  • Use InferenceEngine::CNNNetwork::reshape to set new input shapes for your first model that does not have batch dimension.