Community
cancel
Showing results for 
Search instead for 
Did you mean: 
scalopus
Beginner
116 Views

Compile end2end_video_analytics and got error /main.cpp:128:37 InferenceEngineException

Hi,

I am zero knowledge in C++, OpenVino, RPi. In this post, I'm not sure that I fix it correctly or not but at least it is help me to success the compile.

So, This is the error when run intel/openvino/inference_engine/samples/build_samples.sh

----------------

/opt/intel/openvino/inference_engine/samples/end2end_video_analytics/end2end_video_analytics_ie/main.cpp: In function ‘int main(int, char**)’:
/opt/intel/openvino/inference_engine/samples/end2end_video_analytics/end2end_video_analytics_ie/main.cpp:128:37: error: catching polymorphic type ‘class InferenceEngine::details::InferenceEngineException’ by value [-Werror=catch-value=]
     catch (InferenceEngineException ex) {
                                     ^~
In file included from /usr/include/c++/8/vector:69,
                 from /home/pi/inference_engine_samples_build/thirdparty/gflags/include/gflags/gflags.h:82,
   
             from /opt/intel/openvino/inference_engine/samples/end2end_video_analytics/end2end_video_analytics_ie/main.h:7,
   
             from /opt/intel/openvino/inference_engine/samples/end2end_video_analytics/end2end_video_analytics_ie/main.cpp:9:
/usr/include/c++/8/bits/vector.tcc: In member function ‘void std::vector<_Tp, _Alloc>::_M_realloc_insert(std::vector<_Tp, _Alloc>::iterator, _Args&& ...) [with _Args = {double}; _Tp = double; _Alloc = std::allocator<double>]’:
/usr/include/c++/8/bits/vector.tcc:413:7: note: parameter passing for argument of type ‘std::vector<double, std::allocator<double> >::iterator’ {aka ‘__gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >’} changed in GCC 7.1
       vector<_Tp, _Alloc>::
       ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/8/bits/vector.tcc: In member function ‘void std::vector<_Tp, _Alloc>::emplace_back(_Args&& ...) [with _Args = {double}; _Tp = double; _Alloc = std::allocator<double>]’:
/usr/include/c++/8/bits/vector.tcc:109:4: note: parameter passing for argument of type ‘__gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >’ changed in GCC 7.1
    _M_realloc_insert(end(), std::forward<_Args>(__args)...);
    ^~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
make[2]: *** [end2end_video_analytics/end2end_video_analytics_ie/CMakeFiles/end2end_video_analytics_ie.dir/build.make:63: end2end_video_analytics/end2end_video_analytics_ie/CMakeFiles/end2end_video_analytics_ie.dir/main.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:556: end2end_video_analytics/end2end_video_analytics_ie/CMakeFiles/end2end_video_analytics_ie.dir/all] Error 2
make: *** [Makefile:130: all] Error 2
Error on or near line 71; exiting with status 1

----------------

I found that in another exmaple is using InferenceEngineException as InferenceEngineException&. So, I just change the end2end_video_analytics_ie/main.cpp Line 128 to use the sam

From 

catch (InferenceEngineException ex) {

to

catch (InferenceEngineException& ex) {

After changed, i got successful compiled. with below warning

-------------------------------------------

In file included from /usr/include/c++/8/vector:69,
                 from /home/pi/inference_engine_samples_build/thirdparty/gflags/include/gflags/gflags.h:82,
                 from /opt/intel/openvino/inference_engine/samples/end2end_video_analytics/end2end_video_analytics_ie/main.h:7,
                 from /opt/intel/openvino/inference_engine/samples/end2end_video_analytics/end2end_video_analytics_ie/main.cpp:9:
/usr/include/c++/8/bits/vector.tcc: In member function ‘void std::vector<_Tp, _Alloc>::_M_realloc_insert(std::vector<_Tp, _Alloc>::iterator, _Args&& ...) [with _Args = {double}; _Tp = double; _Alloc = std::allocator<double>]’:
/usr/include/c++/8/bits/vector.tcc:413:7: note: parameter passing for argument of type ‘std::vector<double, std::allocator<double> >::iterator’ {aka ‘__gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >’} changed in GCC 7.1
       vector<_Tp, _Alloc>::
 
     ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/8/bits/vector.tcc: In member function ‘void std::vector<_Tp, _Alloc>::emplace_back(_Args&& ...) [with _Args = {double}; _Tp = double; _Alloc = std::allocator<double>]’:
/usr/include/c++/8/bits/vector.tcc:109:4: note: parameter passing for argument of type ‘__gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >’ changed in GCC 7.1
    _M_realloc_insert(end(), std::forward<_Args>(__args)...);
    ^~~~~~~~~~~~~~~~~
-----------------------------------------------------

I just leave the information here in case someone may experience like me. And also please correct me if I am wrong.

gcc (Raspbian 8.3.0-6+rpi1) 8.3.0
Raspbian GNU/Linux 10
cmake version 3.13.4

 

 

 

0 Kudos
4 Replies
Shubha_R_Intel
Employee
116 Views

Dear scalopus,

did you run setupvars.sh first ? 

Please report back here.

If you ran setupvars.sh from your terminal, and then executed the end2end_video_analytics sample from that terminal (this is essential since proper environment variables need to be set), then you should not have to modify your code in any way to get things to compile.

Are you sure that you're carefully following every step outlined in Install OpenVino on Rasp PI Doc ?

Please report back on this forum.

Thanks !

Shubha

 

scalopus
Beginner
116 Views

Hi,

Yes, already run the setupvars.sh. I have follow the instruction step by step from the fresh os installation.

Note that the guideline is "These steps apply to 32-bit Raspbian* 9 OS (Stretch), which is an official OS for Raspberry Pi* boards."

But I have run on the latest raspbian 10 which based on Debian 10 which just release for just a day.

Shubha_R_Intel
Employee
116 Views

Dear scalopus,

Got it. I see. 

The following information is key:

But I have run on the latest raspbian 10 which based on Debian 10 which just release for just a day.

We have not validated on raspbian 10. Hopefully someone in the community can help you ? Meanwhile I will submit a feature request to support raspbian 10.

Thanks,

Shubha

scalopus
Beginner
116 Views

Thank for submitting the feature request. I don't need special support for this topic. Just throw the information here in case that someone may experience the same issue and find the way out.

I think the workaround that I post here should be ok enough as the variable use nowhere in the code block. 

Reply