Added check in hello sample (#2896)
* Added check in hello sample * move check before inference
This commit is contained in:
parent
1a1451ed8f
commit
50e6d0e31e
@ -98,6 +98,7 @@ int main(int argc, char *argv[]) {
|
|||||||
// -----------------------------------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
// --------------------------- 3. Configure input & output ---------------------------------------------
|
// --------------------------- 3. Configure input & output ---------------------------------------------
|
||||||
|
if (network.getOutputsInfo().size() != 1) throw std::logic_error("Sample supports topologies with 1 output only");
|
||||||
|
|
||||||
// --------------------------- Prepare input blobs -----------------------------------------------------
|
// --------------------------- Prepare input blobs -----------------------------------------------------
|
||||||
slog::info << "Preparing input blobs" << slog::endl;
|
slog::info << "Preparing input blobs" << slog::endl;
|
||||||
@ -214,7 +215,6 @@ int main(int argc, char *argv[]) {
|
|||||||
// --------------------------- 8. Process output -------------------------------------------------------
|
// --------------------------- 8. Process output -------------------------------------------------------
|
||||||
slog::info << "Processing output blobs" << slog::endl;
|
slog::info << "Processing output blobs" << slog::endl;
|
||||||
OutputsDataMap outputInfo(network.getOutputsInfo());
|
OutputsDataMap outputInfo(network.getOutputsInfo());
|
||||||
if (outputInfo.size() != 1) throw std::logic_error("Sample supports topologies with 1 output only");
|
|
||||||
Blob::Ptr outputBlob = inferRequest.GetBlob(outputInfo.begin()->first);
|
Blob::Ptr outputBlob = inferRequest.GetBlob(outputInfo.begin()->first);
|
||||||
|
|
||||||
/** Validating -nt value **/
|
/** Validating -nt value **/
|
||||||
|
@ -86,6 +86,7 @@ int main(int argc, char *argv[]) {
|
|||||||
|
|
||||||
// 2. Read a model in OpenVINO Intermediate Representation (.xml and .bin files) or ONNX (.onnx file) format
|
// 2. Read a model in OpenVINO Intermediate Representation (.xml and .bin files) or ONNX (.onnx file) format
|
||||||
CNNNetwork network = ie.ReadNetwork(input_model);
|
CNNNetwork network = ie.ReadNetwork(input_model);
|
||||||
|
if (network.getOutputsInfo().size() != 1) throw std::logic_error("Sample supports topologies with 1 output only");
|
||||||
network.setBatchSize(1);
|
network.setBatchSize(1);
|
||||||
// -----------------------------------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user