win10+vs2017 下把cuda cmake到dlib中成功使用dnn功能

软件及环境:win10(64bit), vs2017, cuda9.1+cudnn7.0, cmake3.10.0, dlib19.13

安装步骤:

    1. 到dlib的"example"目录下打开CMD命令

    2. 依照官网次输入命令:

    VS2017版本

 

cd examples
mkdir build
cd build
cmake -G "Visual Studio 15 2017 Win64" -T host=x64 ..
cmake --build . --config Release(可以不用这一步,这个只是帮你全编译,可以选择用vs编译一样的)

    VS2015版本:

 

cd examples
mkdir build
cd build
cmake -G "Visual Studio 14 2015 Win64" -T host=x64 ..
cmake --build . --config Release(可以不用这一步,这个只是帮你全编译,可以选择用vs编译一样的)

    3. 打开"build"文件夹下面的"example.sln"或"dlib.sln",编译并测试

遇到的问题:

    官方说的是支持vs2015以及更新版本的VS

    但是:在VS2015版本可以成功把cuda cmake进入dlib并能使用dnn功能,而vs2017则不会,cmake的提示信息:

-- ******************************************************************************************
-- Your version of Visual Studio has incomplete C++11 support and is unable to compile the
-- DNN examples. So we are disabling the deep learning tools.  If you want to use the DNN
-- tools in dlib then update your copy of Visual Studio.

-- ******************************************************************************************

    以及:

-- Found CUDA: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v9.2 (found suitable version "9.2", minimum required is "7.5")
-- *** Dlib CUDA support requires C++11 but your compiler doesn't support it. ***
-- Disabling CUDA support for dlib.  DLIB WILL NOT USE CUDA

-- C++11 activated.

    提示VS2017不支持C++11并且cdnn不会被使用。

    通过各种途径,最终找到关键点:关键点

    根据提示,只把set_compiler_specific_options.cmake的第34行里的1910版本改成其它的数字或是去掉就可以不执行这里的

    操作(PS: 这里太简单粗暴了哈,不过也只有死马当活马医,最终刚好可以解决我们的问题,虽然并不能完全配置好dlib

  

    结果: 终于可以编译并运行dnn的大部分样例,不过也有少数比如dnn_metric_learning_on_images_ex项目编译就会一直

        处于“卡死”的编译状态

    现在就这样,如果以后需要再花时间继续解决吧

 

 

作者的回答

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.

 

 

2018.07.20更新:

据说最近的VS2017 15.5可以编译,但是不太支持CUDA, 早一点的版本又在C++11方面不太支持。

看来还需要进一步的协调吧

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值