patrikhuber / eos

A lightweight 3D Morphable Face Model library in modern C++
Apache License 2.0
1.91k stars 598 forks source link

Error during make #43

Closed CRoger2016 closed 8 years ago

CRoger2016 commented 8 years ago

Hello, First of all thank you for offering this code!

I have no particular programming experience, so I'm having issues getting it to work:

I tried in Visual Studio, and managed to get it all built up, but when I try to run the fit-model.exe, I get a debug error saying abort() has been called... Could it be because I tried to build it in x64?

I've also tried using MinGW, but I get this error at the beginning during the make && make install step:

Scanning dependencies of target fit-model
[ 25%] Building CXX object examples/CMakeFiles/fit-model.dir/fit-model.cpp.obj
In file included from C:\MinGW\include/windef.h:253:0,
                 from C:\MinGW\include/excpt.h:20,
                 from C:\MinGW\include/boost/archive/archive_exception.hpp:31,
                 from C:\MinGW\include/boost/multi_index/detail/index_node_base.hpp:21,
                 from C:\MinGW\include/boost/multi_index/detail/node_type.hpp:23,
                 from C:\MinGW\include/boost/multi_index/detail/index_base.hpp:25,
                 from C:\MinGW\include/boost/multi_index/detail/base_type.hpp:21,
                 from C:\MinGW\include/boost/multi_index_container.hpp:34,
                 from C:\MinGW\include/boost/property_tree/ptree.hpp:21,
                 from C:/Users/roger/Desktop/eos/include/eos/core/LandmarkMapper.hpp:27,
                 from C:\Users\roger\Desktop\eos\examples\fit-model.cpp:21:
C:\MinGW\include/winnt.h:2399:2: error: #error "undefined processor type"
 #error "undefined processor type"
  ^~~~~

Then it keeps going for a while and finishes with this:

In file included from C:/Users/roger/Desktop/eos/include/eos/render/texture_extraction.hpp:35:0,
                 from C:\Users\roger\Desktop\eos\examples\fit-model.cpp:25:
c:\mingw\include\c++\6.1.0\future: At global scope:
c:\mingw\include\c++\6.1.0\future:183:5: error: 'std::future<typename std::result_of<typename std::decay<_Tp>::type(typename std::decay<_BoundArgs>::type ...)>::type> std::async(_Fn&&, _Args&& ...) [with _Fn = eos::render::extract_texture(eos::render::Mesh, cv::Mat, cv::Mat, cv::Mat, bool, eos::render::TextureInterpolation, int)::<lambda()>&; _Args = {}; typename std::result_of<typename std::decay<_Tp>::type(typename std::decay<_BoundArgs>::type ...)>::type = void]', declared using local type 'eos::render::extract_texture(eos::render::Mesh, cv::Mat, cv::Mat, cv::Mat, bool, eos::render::TextureInterpolation, int)::<lambda()>', is used but never defined [-fpermissive]
     async(_Fn&& __fn, _Args&&... __args);
     ^~~~~
make[2]: *** [examples\CMakeFiles\fit-model.dir\build.make:63: examples/CMakeFiles/fit-model.dir/fit-model.cpp.obj] Error 1
make[1]: *** [CMakeFiles\Makefile2:119: examples/CMakeFiles/fit-model.dir/all] Error 2
make: *** [Makefile:149: all] Error 2

I am not sure what I'm doing wrong... Could you help me fix those or give me advice (like for a complete beginner) as to how to make it work without errors?

Thank you, Roger.

PS: I have Windows 10, x64.

patrikhuber commented 8 years ago

Hi,

Building it as x64 is fine, in fact you should prefer x64. I would not advise you to try building in MingW64 - first of all I haven't tested the code in MingW64, but second, building in MingW64 is imho harder for beginners and if errors crop up, you don't know what to do. So let's focus on Visual Studio.

Can you confirm you're using VS2015, preferably with the latest update (U2 or U3)?

but when I try to run the fit-model.exe, I get a debug error saying abort() has been called...

Did you specify command-line arguments? (it shouldn't abort() though...). Did you run the INSTALL target as described in the readme file? Can you run again in VS in debug mode and then look at the call stack when it aborts and find the place in the eos code where the issue arises? All this should be visible from the call stack.

CRoger2016 commented 8 years ago

I do have Visual Studio 2015, Update 3.

I get an abort error even when I specify the arguments; I thought I had followed the instructions right though yes...

When the abort error showed up, I clicked on Debug in VS2015, and it told me the program had triggered a breakpoint, this is what the call stack looks like:

    ucrtbased.dll!__threadid() Unknown
    ucrtbased.dll!__acrt_report_runtime_error()    Unknown
    ucrtbased.dll!abort()  Unknown
    ucrtbased.dll!terminate()  Unknown
>   fit-model.exe!__scrt_unhandled_exception_filter(_EXCEPTION_POINTERS * const pointers) Line 78   C++
    KernelBase.dll!UnhandledExceptionFilter()  Unknown
    ntdll.dll!RtlUserThreadStart$filt$0()   Unknown
    ntdll.dll!__C_specific_handler()   Unknown
    ntdll.dll!RtlpExecuteHandlerForException() Unknown
    ntdll.dll!RtlDispatchException()    Unknown
    ntdll.dll!RtlRaiseException()   Unknown
    KernelBase.dll!RaiseException()    Unknown
    vcruntime140.dll!__CxxCallCatchBlock(_EXCEPTION_RECORD * pExcept) Line 1342 C++
    ntdll.dll!RcConsolidateFrames()    Unknown
    boost_program_options-vc140-mt-1_61.dll!00007ffa37556021()  Unknown
    [External Code] 
    boost_program_options-vc140-mt-1_61.dll!00007ffa3752a67a()  Unknown
    boost_program_options-vc140-mt-1_61.dll!00007ffa3752b716()  Unknown
    boost_program_options-vc140-mt-1_61.dll!00007ffa37536a3a()  Unknown
    fit-model.exe!main(int argc, char * * argv) Line 115    C++
    [External Code] 
patrikhuber commented 8 years ago

Hm, it does look like it's just an issue with the command line arguments. Maybe we need to improve that error handling.

Can you run the INSTALL target and then go to $INSTALL_DIR$/bin and execute fit-model? It should run without any arguments (i.e. the default arguments are fine when run from that location). Please verify you have a directory ../share (relative from the bin/ dir) with all the data files (the model etc.).

I hope this info is all correct, on the phone and can't verify the details.

On 19 Jul 2016 18:54, "CRoger2016" notifications@github.com wrote:

I do have Visual Studio 2015, Update 3.

I get an abort error even when I specify the arguments; I thought I had followed the instructions right though yes...

When the abort error showed up, I clicked on Debug in VS2015, and it told me the program had triggered a breakpoint, this is what the call stack looks like:

ucrtbased.dll!threadid�() Unknown ucrtbased.dll!acrt_report_runtime_error�() Unknown ucrtbased.dll!abort�() Unknown ucrtbased.dll!terminate�() Unknown

fit-model.exe!__scrt_unhandled_exception_filter(_EXCEPTION_POINTERS const pointers) Line 78 C++ KernelBase.dll!UnhandledExceptionFilter�() Unknown ntdll.dll!RtlUserThreadStart$filt$0() Unknown ntdll.dll!C_specific_handler�() Unknown ntdll.dll!RtlpExecuteHandlerForException�() Unknown ntdll.dll!RtlDispatchException() Unknown ntdll.dll!RtlRaiseException() Unknown KernelBase.dll!RaiseException�() Unknown vcruntime140.dll!CxxCallCatchBlock(_EXCEPTION_RECORD * pExcept) Line 1342 C++ ntdll.dll!RcConsolidateFrames�() Unknown boost_program_options-vc140-mt-1_61.dll!00007ffa37556021() Unknown [External Code] boost_program_options-vc140-mt-1_61.dll!00007ffa3752a67a() Unknown boost_program_options-vc140-mt-1_61.dll!00007ffa3752b716() Unknown boost_program_options-vc140-mt-1_61.dll!00007ffa37536a3a() Unknown fit-model.exe!main(int argc, char * \ argv) Line 115 C++ [External Code]

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/patrikhuber/eos/issues/43#issuecomment-233713574, or mute the thread https://github.com/notifications/unsubscribe-auth/AEvLr2yaAbyY0reS8oMdwMpKzYkCblRHks5qXQ9mgaJpZM4JPy_a .

CRoger2016 commented 8 years ago

I do seem to have all the data in the share folder (8 items, including model_contours, the model, reference etc...);

When I executed fit-model however, it said "The program can't start because opencv_world310d.dll is missing from your computer. Try reinstalling the program to fix this problem."

Which is weird because I know I have it...

patrikhuber commented 8 years ago

The path to the DLLs needs to be either in your Windows PATH variable, or you can copy the dll files to the bin/ dir. I usually add the opencv dir to the PATH.

CRoger2016 commented 8 years ago

I added it to my PATH variable, but now I get the debug error (abort called) again, with the exact same call stack...

patrikhuber commented 8 years ago

The call stack should reveal where exactly it is crashing in fit-model. Run it in VS, when it crashes, doubleclick on the line fit-model.exe!main(int argc, char * * argv) Line 115 C++ in the call stack, and it should jump the cursor to the exact line where it's crashing and give you all information with it (e.g. the values of all variables). You should be able to find out pretty easily what's going wrong.

Once you find out we can then try to improve that error handling in your specific case.

CRoger2016 commented 8 years ago

My bad, the error says: Unhandled exception at 0x00007FF85F131F28 in fit-model.exe: Microsoft C++ exception: std::bad_alloc at memory location 0x000000D68F100160.

And the call stack looks now like this:

ucrtbased.dll!threadid() Unknown ucrtbased.dll!acrt_report_runtime_error() Unknown ucrtbased.dll!abort() Unknown ucrtbased.dll!terminate() Unknown fit-model.exe!00007ff771c9853b() Unknown [External Code] boost_program_options-vc140-mt-1_61.dll!00007ff84e096021() Unknown [External Code] boost_program_options-vc140-mt-1_61.dll!00007ff84e06a67a() Unknown boost_program_options-vc140-mt-1_61.dll!00007ff84e06b716() Unknown boost_program_options-vc140-mt-1_61.dll!00007ff84e076a3a() Unknown fit-model.exe!00007ff771b52d5f() Unknown fit-model.exe!00007ff771c97a94() Unknown fit-model.exe!00007ff771c97957() Unknown fit-model.exe!00007ff771c9781e() Unknown fit-model.exe!00007ff771c97ab9() Unknown [External Code]

And when I click on the first line from the bottom, it shows this: 00007FF7A03D7AB9 add rsp,28h

patrikhuber commented 8 years ago

It really looks like debug info is missing. At least it should point to a particular line of code in fit-model. Try setting a breakpoint at the first line in main() and debug step by step. If that's not working, I suspect you have another issue with STL or Boost library versions or something like that.

On 20 Jul 2016 19:26, "CRoger2016" notifications@github.com wrote:

My bad, the error says: Unhandled exception at 0x00007FF85F131F28 in fit-model.exe: Microsoft C++ exception: std::bad_alloc at memory location 0x000000D68F100160.

And the call stack looks now like this:

ucrtbased.dll!threadid�() Unknown ucrtbased.dll!acrt_report_runtime_error�() Unknown ucrtbased.dll!abort�() Unknown ucrtbased.dll!terminate�() Unknown fit-model.exe!00007ff771c9853b() Unknown [External Code] boost_program_options-vc140-mt-1_61.dll!00007ff84e096021() Unknown [External Code] boost_program_options-vc140-mt-1_61.dll!00007ff84e06a67a() Unknown boost_program_options-vc140-mt-1_61.dll!00007ff84e06b716() Unknown boost_program_options-vc140-mt-1_61.dll!00007ff84e076a3a() Unknown fit-model.exe!00007ff771b52d5f() Unknown fit-model.exe!00007ff771c97a94() Unknown fit-model.exe!00007ff771c97957() Unknown fit-model.exe!00007ff771c9781e() Unknown fit-model.exe!00007ff771c97ab9() Unknown [External Code]

And when I click on the first line from the bottom, it shows this: 00007FF7A03D7AB9 add rsp,28h

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/patrikhuber/eos/issues/43#issuecomment-234037592, or mute the thread https://github.com/notifications/unsubscribe-auth/AEvLrxUJoLBkxiQcVU8YnY36SKhVEHNFks5qXmgzgaJpZM4JPy_a .

CRoger2016 commented 8 years ago

I could not manage to see the code to debug (main()), so I tried re-installing Boost and rebuilding it, and now it works! Thank you for your help!

patrikhuber commented 8 years ago

Cool! Btw, for next time, there's usually no need to build boost, you can use the official prebuilt binaries from boost.

On 27 Jul 2016 6:12 a.m., "CRoger2016" notifications@github.com wrote:

I could not manage to see the code to debug (main()), so I tried re-installing Boost and rebuilding it, and now it works! Thank you for your help!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/patrikhuber/eos/issues/43#issuecomment-235580146, or mute the thread https://github.com/notifications/unsubscribe-auth/AEvLryltECB6AHHWGckqQrm2-Y7o5n0Qks5qZ1kkgaJpZM4JPy_a .

CRoger2016 commented 8 years ago

Duly noted, thanks! Also, is it possible to use this software with my own images? I would like to create my own .pts file for the image I want to use, but I'm having trouble understanding the way the landmarks are written in the pts file provided in the data folder (I would expect 68 xy-pairs of coordinates for each landmark, but that is not what it is). Could you tell me how the landmarks are recorded?

patrikhuber commented 8 years ago

Sure. We follow the ibug format in the example. They are 68 xy-pairs, ordered. #30 has more details and links.

patrikhuber commented 8 years ago

Renamed the wrong issue by accident ;-)

CRoger2016 commented 8 years ago

Alright, thank you very much! (And sorry, I hadn't read the other issues)