Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.
6392 Discussions

"Batch size should be equal to the number of images" error without explanation in OpenVINO

adammpolak
New Contributor I
579 Views

I have been trying to run the hello_classification example in my C++ project

 

I have managed to get it to compile and take in the model as well as network.

 

I am now receiving this error: "Batch size should be equal to the number of images."

 

It does not let me know what line in "hello_classification", main.cpp would provide this error, what does it mean?

0 Kudos
3 Replies
adammpolak
New Contributor I
574 Views

Heads up, I am providing hello_classification the cv::Mat directly in `Blob::Ptr imgBlob = wrapMat2Blob(image);`

 

rather than using `cv::Mat image = imread_t(input_image_path);`

 

(Which means that I am calling `ClassificationResult_t classificationResult(output);` instead of 

`ClassificationResult_t classificationResult(output, {input_image_path});` in step
 
0 Kudos
Wan_Intel
Moderator
527 Views

Hi Adammpolak,

Thank you for reaching out to us and thank you for using the OpenVINO™ toolkit!

 

Are you using the latest version of the OpenVINO™ toolkit to run the hello_classification example in your C++ project?

 

Based on the latest version of the OpenVINO™ toolkit, the error you encountered: “Batch size should be equal to the number of images” was caused by the “classification_results.h” file from line 129 to line 131.

 

For your information, a different version of the OpenVINO™ toolkit, the error will be caused by the same file as well. But the lines that cause the error will differ.

 

The “classification_results.h” file is located under the following directory:

<INSTALL_DIR>\inference_engine\samples\cpp\common\utils\include\samples\ classification_results.h

 

Hope it helps.

 

 

Regards,

Wan


0 Kudos
Wan_Intel
Moderator
476 Views

Hi Adammpolak,

Thank you for your question.


This thread will no longer be monitored since we have provided a solution.

If you need any additional information from Intel, please submit a new question.



Regards,

Wan


0 Kudos
Reply