Added check in hello sample (#2896)

* Added check in hello sample

* move check before inference
This commit is contained in:
Anton Romanov 2020-11-02 19:34:06 -08:00 committed by GitHub
parent 1a1451ed8f
commit 50e6d0e31e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -98,6 +98,7 @@ int main(int argc, char *argv[]) {
// -----------------------------------------------------------------------------------------------------
// --------------------------- 3. Configure input & output ---------------------------------------------
if (network.getOutputsInfo().size() != 1) throw std::logic_error("Sample supports topologies with 1 output only");
// --------------------------- Prepare input blobs -----------------------------------------------------
slog::info << "Preparing input blobs" << slog::endl;
@ -214,7 +215,6 @@ int main(int argc, char *argv[]) {
// --------------------------- 8. Process output -------------------------------------------------------
slog::info << "Processing output blobs" << slog::endl;
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);
/** Validating -nt value **/

View File

@ -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
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);
// -----------------------------------------------------------------------------------------------------