microsoft / azure-percept-advanced-development

Azure Percept DK advanced topics
Other
70 stars 33 forks source link

[BUG] stoi error when running compile_and_test.[sh|ps1] scripts #73

Closed sadhoss closed 2 years ago

sadhoss commented 2 years ago

Describe the bug Following the PyTorch from Scratch Tutorial I get the following error, when trying to run detection through the mock-eye-module:

terminate called after throwing an instance of 'std::invalid_argument'  
  what():  stoi

The model used is pulled from openvino workbench zoo. The default ssd model to test the mock-eye-module container. Hence error should not be related to the model ssd_mobilenet_v2_coco.

Mock-eye-module by itself is compiling fine.

Based on simple debugging, error seems to be from the G-API when executed.

To Reproduce Steps to reproduce the behavior: Follow all steps in Prerequisites.

When converted model, and video person-bicycle-car-detection.mp4 downloaded.

I run the following on mac:

./scripts/compile_and_test.sh --video=test-artifacts/person-bicycle-car-detection.mp4 --weights=test-artifacts/ssd_mobilenet_v2_coco.bin --xml=test-artifacts/ssd_mobilenet_v2_coco.xml

I run the following on windows:

./scripts/compile_and_test.ps1 -ipaddr <your IP address> -xml test-artifacts/ssd_mobilenet_v2_coco.xml -video test-artifacts/person-bicycle-car-detection.mp4

Both return:

[setupvars.sh] OpenVINO environment initialized
-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found OpenCV: /opt/intel/openvino_2021.1.110/opencv (found version "4.5.0") found components:  gapi highgui 
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1") 
-- Checking for module 'gstreamer-1.0>=1.14'
--   Found gstreamer-1.0, version 1.16.2
-- Found InferenceEngine: /opt/intel/openvino/deployment_tools/inference_engine/lib/intel64/libinference_engine.so (Required is at least version "2.0") 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/openvino/tmp/build
Scanning dependencies of target mock_eye_app
[ 14%] Building CXX object CMakeFiles/mock_eye_app.dir/main.cpp.o
[ 28%] Building CXX object CMakeFiles/mock_eye_app.dir/kernels/ssd_kernels.cpp.o
[ 42%] Building CXX object CMakeFiles/mock_eye_app.dir/kernels/utils.cpp.o
[ 57%] Building CXX object CMakeFiles/mock_eye_app.dir/modules/device.cpp.o
[ 71%] Building CXX object CMakeFiles/mock_eye_app.dir/modules/objectdetection/object_detectors.cpp.o
[ 85%] Building CXX object CMakeFiles/mock_eye_app.dir/modules/parser.cpp.o
[100%] Linking CXX executable mock_eye_app
[100%] Built target mock_eye_app
Cannot open labelfile /home/openvino/tmp/labels.txt
Labels will not be available.
terminate called after throwing an instance of 'std::invalid_argument'
  what():  stoi

Expected behavior Based on the documentation, a window should pop out and stream a video with object detection overplayed.

Additional context Additional observation The scripts compile_and_test.sh expects an "example" folder in the mock-eye-module, not included when cloning the repo. The "mock-eye-module-debug" pulls "openvino/ubuntu18_runtime:latest" instead of "openvino/ubuntu18_runtime:2021.1".

akdaly commented 2 years ago

I have a follow up question to one of your additional observations:

For the "example" folder problem, did you add another folder or did you modify the code? I commented the section out but now it just prints out

Screen Shot 2022-05-17 at 3 52 45 PM

It does not give any errors, but it does not create a tmp file.

I am on MacOS for context

sadhoss commented 2 years ago

@akdaly I just added the "example" folder. I Have not had an issue with it since.

Regarding the <stoi error when running compile_and_test.sh|ps1>, it has been a while since I worked on this, but I did/have gone past this error. One of those errors that just went away after a while. Will add a better explanation/resolution if I remember it!

akdaly commented 2 years ago

@sadhoss Thank you! That could be really helpful, especially if you used MacOS, but if you do not remember no worries!