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.
6462 Discussions

Not getting correct predictions using OpenVino C++ while Python version is OK

TarunM
Beginner
1,570 Views

I need to convert my code to C++ for deployment purposes. My model, once converted to OpenVino, produces the expected results in Python but not in C++. I believe there might be an issue with my C++ implementation, possibly related to converting cv::Mat to an OpenVino tensor, perhaps involving the channel nhwc.

I've included a zipped file (files.zip) that contains:

  1. My Python code (providing the expected results)
  2. My C++ code (yielding different results)
  3. A test image used by both the C++ and Python files
  4. OpenVino converted model.

I've also written a function to analyze the differences in predictions between the C++ and Python implementations. The C++ code predicts and saves the result in a binary file, and the Python code predicts, reads the bin file, and calculates the error.

Please help. 

0 Kudos
6 Replies
Hairul_Intel
Moderator
1,546 Views

Hi TarunM,

Thank you for reaching out to us.

 

We're investigating this issue and will update you on any findings as soon as possible.

 

On a side note, could you share the following details with us:

  • OpenVINO version
  • OS version

 

 

Regards,

Hairul


0 Kudos
TarunM
Beginner
1,534 Views

OpenVino version 2023.0.1

OS: Windows 10

The model has been converted using the 2022 Openvino version. 

0 Kudos
TarunM
Beginner
1,433 Views

Is there any possibility that you will help in it ? or should I declare OpenVino is only good for toy AI applications and move on to other platforms for serious deployments?

0 Kudos
TarunM
Beginner
1,485 Views

@Hairul is there any update?

0 Kudos
Hairul_Intel
Moderator
1,349 Views

Hi TarunM,

We just got feedback from the Engineering team regarding this issue.

 

They confirmed that the problem was due to incorrect filling of tensor data in the preprocessing part of your C++ code. The channels in the attached model are on the last place, so they corrected the main.cpp (see the attachments).

 

Please test out using the new main.cpp file and let us know if the issue is resolved.

 

 

Regards,

Hairul

 

0 Kudos
Hairul_Intel
Moderator
1,200 Views

Hi TarunM,

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,

Hairul


0 Kudos
Reply