Ask Your Question

could not run demo "faster_rcnn.cpp"

asked 2018-02-05 03:32:39 -0500

meccaendless gravatar image

updated 2018-02-05 19:21:11 -0500

Hi guys, we have downloaded the lastest version of opencv 3.4, and set up the vs2017 environment for opencv. We also downlloaded the faster_rcnn_vgg16.prototxt, and VGG16_faster_rcnn_final.caffemodel from However,when we run the faster_rcnn.cpp, the detection out is null. And vs2017 have a interrupt , the program stop at here:

 #ifdef _DEBUG
 _CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL _Debug_message(const wchar_t *message, const wchar_t *file,  unsigned int line)
    {   // report error and die        if(::_CrtDbgReportW(_CRT_ASSERT, file, line, NULL, L"%ls", message)==1)

and the output messages show:

Second Chance Assertion Failed: File C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.11.25503\include\vector, Line 1810

here show some codes. Thanks!

  1. interrupt occur in stdthrow.cpp:

    // throw -- terminate on thrown exception REPLACEABLE #ifndef _M_CEE_PURE #define _HAS_EXCEPTIONS 0 #endif /* _M_CEE_PURE */ #include <cstdio> #include <cstdlib> #include <exception> #include <crtdbg.h>


    #ifdef _DEBUG

    _CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL _Debug_message(const wchar_t *message, const wchar_t *file, unsigned int line)

    {   // report error and die
        if(::_CrtDbgReportW(_CRT_ASSERT, file, line, NULL, L"%ls", message)==1)// STOP HERE!!--marked by me

    _CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL _Debug_message(const unsigned short *message, const unsigned short *file, unsigned int line) { // report error and die _Debug_message((wchar_t *) message, (wchar_t *) file, line); }




    • Copyright (c) by P.J. Plauger. All rights reserved.
    • Consult your license regarding permissions and restrictions. V6.50:0009 */

2 console outputs:

[libprotobuf WARNING C:\build\master_winpack-build-win64-vc15\opencv\3rdparty\protobuf\src\google\protobuf\io\] Reading dangerously large protocol message.  If the message turns out to be larger than 2147483647 bytes, parsing will be halted for security reasons.  To increase the limit (or to disable these warnings), see CodedInputStream::SetTotalBytesLimit() in google/protobuf/io/coded_stream.h.
[libprotobuf WARNING C:\build\master_winpack-build-win64-vc15\opencv\3rdparty\protobuf\src\google\protobuf\io\] The total number of bytes read was 548317115
[ INFO:0] Initialize OpenCL runtime...

Net Outputs(1): detection_out

3 project fold image description

edit retag flag offensive close merge delete


please check, if you accidentally link opencv debug libs to a release project (or the other way round)

berak gravatar imageberak ( 2018-02-05 03:40:45 -0500 )edit

I have update the text version,please check. I linked opencv_world340d.lib for x64 debug mode before the question.

meccaendless gravatar imagemeccaendless ( 2018-02-05 04:41:30 -0500 )edit

please check again, if you also link the release lib , somehow. (global configurations, and whatnot)

problem seems to be in your project, not in the code.

berak gravatar imageberak ( 2018-02-05 04:45:34 -0500 )edit

What deserves to be mentioned the most is caffe_googlenet.cpp( be run correctly. I think the global configurations and libs have been set correctly.

meccaendless gravatar imagemeccaendless ( 2018-02-05 04:52:57 -0500 )edit

Here are my configurations:

lib path of vc++: D:\opencv\build\x64\vc15\lib

include of vc++: D:\opencv\build\include\opencv2;D:\opencv\build\include\opencv;D:\opencv\build\include

input of inker:opencv_world340d.lib

path of environment variables :D:\opencv\build\x64\vc15\bin

meccaendless gravatar imagemeccaendless ( 2018-02-05 04:56:44 -0500 )edit

@meccaendless... link text I am also getting the error for faster RCNN. If you get the solution, kindly post it here.

vps gravatar imagevps ( 2018-02-06 04:05:46 -0500 )edit

hmm, maybe watch this

berak gravatar imageberak ( 2018-02-06 04:17:22 -0500 )edit

I've modified the pooling layer by the instruction. But I'm so sorry,it doesn't work. The error messages are still same with the earily. By the way, I used win10+vs2017+cpu to run the faster rcnn demo but faild. However, the caffe_googlenet demo succeed.

meccaendless gravatar imagemeccaendless ( 2018-02-06 04:50:30 -0500 )edit

@vps. Of course.

meccaendless gravatar imagemeccaendless ( 2018-02-06 05:01:17 -0500 )edit

@meccaendless ...Hi, it is nice to hear. I will install new version of opencv. It may be , I am doing wrong steps to run the program. Can you tell me the exact steps to run this. I am working on window.

vps gravatar imagevps ( 2018-03-01 03:10:50 -0500 )edit

1 answer

Sort by » oldest newest most voted

answered 2018-03-01 01:09:15 -0500

meccaendless gravatar image

@vps Hello,guy. I have got the solution as the latest version 3.4.1 is online. Just clone it and run. The bugs have been fixed. Thanks for the opencv team!

edit flag offensive delete link more

Question Tools



Asked: 2018-02-05 03:32:39 -0500

Seen: 353 times

Last updated: Feb 05 '18