Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building dlib examples using MS VS 2017 takes forever? #530

Closed
anta40 opened this issue Apr 11, 2017 · 9 comments
Closed

Building dlib examples using MS VS 2017 takes forever? #530

anta40 opened this issue Apr 11, 2017 · 9 comments

Comments

@anta40
Copy link

anta40 commented Apr 11, 2017

My notebook runs 64-bit Windows 10 (8 GB RAM), and already have VS2017 (with all the latest updates) installed. I'm trying to build the dlib examples, and after 8 hours it still stuck at compiling dnn_face_recognition_ex.cpp.

Steps to reproduce:

  1. Get the latest, official dlib (v19.4), and extract it somewhere, e.g C:\dev\dlib-19.4
  2. Run "x64 Native Tools Command Prompt for Visual Studio 2017"
  3. Do the steps described in http://dlib.net/faq.html#HowcanIusedlibinVisualStudio (I use cmake 3.8.0 x64)
  4. Lots of compilation lines will appear, but after reaching dnn_face_recognition_ex.cpp will stuck like this:
    Project "C:\dev\dlib-19.4\examples\build\ALL_BUILD.vcxproj" (1) is building "C:\dev\dlib-19.4\examples\build\dnn_face_recognition_ex.vcxproj" (15) on node 1 (default t
    argets).
    PrepareForBuild:
    Creating directory "dnn_face_recognition_ex.dir\Release".
    Creating directory "dnn_face_recognition_ex.dir\Release\dnn_face.798D7D33.tlog".
    InitializeBuildStatus:
    Creating "dnn_face_recognition_ex.dir\Release\dnn_face.798D7D33.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
    CustomBuild:
    Building Custom Rule C:/dev/dlib-19.4/examples/CMakeLists.txt
    CMake does not need to re-run because C:/dev/dlib-19.4/examples/build/CMakeFiles/generate.stamp is up-to-date.
    ClCompile:
    C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\bin\HostX86\x86\CL.exe /c /I"C:\dev\dlib-19.4\dlib.." /nologo /W3 /WX- /diag
    nostics:classic /O2 /Ob2 /Oy- /D WIN32 /D _WINDOWS /D NDEBUG /D DLIB_HAVE_SSE2 /D "CMAKE_INTDIR="Release"" /D _MBCS /Gm- /EHsc /MD /GS /arch:SSE2 /fp:precise /Zc:w
    char_t /Zc:forScope /Zc:inline /GR /Fo"dnn_face_recognition_ex.dir\Release\" /Fd"dnn_face_recognition_ex.dir\Release\vc141.pdb" /Gd /TP /analyze- /errorReport:queue
    /bigobj "C:\dev\dlib-19.4\examples\dnn_face_recognition_ex.cpp"
    dnn_face_recognition_ex.cpp
@anta40
Copy link
Author

anta40 commented Apr 11, 2017

So far, these are the examples that are successfully compiled.
dexe

Wonder why compiling dnn_face_recognition_ex.cpp take so loooong. Antivirus was disabled before compilation started.

@davisking
Copy link
Owner

Visual Studio 2017 seems to be buggier than Visual Studio 2015. Other people have reported problems. I haven't even successfully installed it. I tried half a dozen times to install VC2017 but the installer crashed every time at some random point. One of the times it took part of windows with it and I needed to restore some files before my desktop functioned correctly.

In any case, this isn't a dlib bug. You should report this to the visual studio dev team and maybe they will fix it. As of right now my recommendation is to avoid visual studio 2017.

@piyush-arora
Copy link

I did some more testing and through commenting code , I found out that the following line is causing the build to stuck forever .

anet_type net;

Here is the minimum code from the face recognition example which is not compiling
#include <dlib/dnn.h>
using namespace dlib;
using namespace std;

template <template <int, templateclass, int, typename> class block, int N, templateclass BN, typename SUBNET>
using residual = add_prev1<block<N, BN, 1, tag1>>;

template <template <int, templateclass, int, typename> class block, int N, templateclass BN, typename SUBNET>
using residual_down = add_prev2<avg_pool<2, 2, 2, 2, skip1<tag2<block<N, BN, 2, tag1>>>>>;

template <int N, template class BN, int stride, typename SUBNET>
using block = BN<con<N, 3, 3, 1, 1, relu<BN<con<N, 3, 3, stride, stride, SUBNET>>>>>;

template <int N, typename SUBNET> using ares = relu<residual<block, N, affine, SUBNET>>;
template <int N, typename SUBNET> using ares_down = relu<residual_down<block, N, affine, SUBNET>>;

template using alevel0 = ares_down<256, SUBNET>;
template using alevel1 = ares<256, ares<256, ares_down<256, SUBNET>>>;
template using alevel2 = ares<128, ares<128, ares_down<128, SUBNET>>>;
template using alevel3 = ares<64, ares<64, ares<64, ares_down<64, SUBNET>>>>;
template using alevel4 = ares<32, ares<32, ares<32, SUBNET>>>;

using anet_type = loss_metric<fc_no_bias<128, avg_pool_everything<
alevel0<
alevel1<
alevel2<
alevel3<
alevel4<
max_pool<3, 3, 2, 2, relu<affine<con<32, 7, 7, 2, 2,
input_rgb_image_sized<150>
>>>>>>>>>>>>;

int main()
{
anet_type net;

}

I think the problem is in loading the dnn module itself but when I was testing the dnn example in visual studio 2017 and it worked perfectly fine
Link : http://dlib.net/dnn_introduction_ex.cpp.html (Tested and working in VS2017)

I thought may be this information can help to solve this issue

@davisking
Copy link
Owner

We know. Sometimes VC2017 glitches out when working with the dnn code and sometimes it doesn't. No one has found a workaround yet.

@piyush-arora
Copy link

piyush-arora commented Jan 6, 2018

Davis was right with the VS2017 glitch , I downloaded the newer version of Visual Studio 2017 Community(Version 15.5.2) and now it works like a charm without any issues what so ever . Just make sure you build the dlib library again with cmake and newer version of VS 2017 .

@davisking
Copy link
Owner

Yes, the very latest VS2017 now works.

@Andyjk1406
Copy link

I'm curious. The latest VS2017 (15.5) doesn't work with Cuda 9, so you have to run 15.4 or choose the v140 toolset in 15.5.
So how did you get all the required features (ie 15.5) to run dlib and get cuda working at the same time?

@davisking
Copy link
Owner

davisking commented Mar 6, 2018 via email

@nguyenthaohut
Copy link

Visual Studio 2017 seems to be buggier than Visual Studio 2015. Other people have reported problems. I haven't even successfully installed it. I tried half a dozen times to install VC2017 but the installer crashed every time at some random point. One of the times it took part of windows with it and I needed to restore some files before my desktop functioned correctly.

In any case, this isn't a dlib bug. You should report this to the visual studio dev team and maybe they will fix it. As of right now my recommendation is to avoid visual studio 2017.

confirm, I meet same problem with VS 2017, install VS 2015 solve all problems

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants