{"id":13437,"date":"2021-02-09T04:41:42","date_gmt":"2021-02-08T20:41:42","guid":{"rendered":"http:\/\/blog.idc.net\/13437\/"},"modified":"2021-02-09T04:41:42","modified_gmt":"2021-02-08T20:41:42","slug":"ubuntu%e4%b8%8bdlib%e5%ba%93%e7%bc%96%e8%af%91%e5%ae%89%e8%a3%85","status":"publish","type":"post","link":"https:\/\/idc.net\/help\/13437\/","title":{"rendered":"Ubuntu\u4e0bdlib\u5e93\u7f16\u8bd1\u5b89\u88c5"},"content":{"rendered":"<div class=\"idc_table\">\n<h3>\u5b89\u88c5libboost<\/h3>\n<pre><code><span>sudo<\/span> apt-get install libboost-all-dev<\/code><\/pre>\n<h3>\u4ecegithub\u514b\u9686\u5e93:<\/h3>\n<pre><code><span>git<\/span> <span>clone<\/span> https:\/\/github.com\/davisking\/dlib.git<\/code><\/pre>\n<h3>build<\/h3>\n<pre><code><span><span>cd<\/span><\/span> dlib\r\n<span>mkdir<\/span> build<span>;<\/span> <span><span>cd<\/span><\/span> build<span>;<\/span> <span>cmake<\/span> .. -DDLIB_USE_CUDA=0 -DUSE_AVX_INSTRUCTIONS=1<span>;<\/span> <span>cmake<\/span> --build .<\/code><\/pre>\n<ul>\n<li><code>-DDLIB_USE_CUDA=0<\/code>\u4e0d\u4f7f\u7528cuda<\/li>\n<li><code>-DUSE_AVX_INSTRUCTIONS=1<\/code>\u4f7f\u7528cpu\u7684AVX\u52a0\u901f<\/li>\n<\/ul>\n<h3>build\u5e76\u5b89\u88c5python\u6269\u5c55<\/h3>\n<pre><code><span><span>cd<\/span><\/span> ..\r\n<span>python<\/span> setup.py install --yes USE_AVX_INSTRUCTIONS --no DLIB_USE_CUDA<\/code><\/pre>\n<ul>\n<li>\u8fd9\u91cc\u53ef\u4ee5\u6307\u5b9apython2\u6216python3,\u4e5f\u53ef\u4ee5\u5728\u865a\u62df\u73af\u5883\u4e2d\u5b89\u88c5.<\/li>\n<li><code>--no DLIB_USE_CUDA<\/code>\u9009\u9879\u4e0d\u4f7f\u7528cuda,\u4f7f\u7528cuda\u53ef\u4ee5\u4e0d\u6307\u5b9a\u8be5\u9009\u9879\u6216<code>DLIB_USE_CUDA<\/code><\/li>\n<\/ul>\n<p>\u5b89\u88c5\u6210\u529f\u53ef\u4ee5\u5728python\u4e2d\u5bfc\u5165dlib<\/p>\n<pre><code><span><span>import<\/span><\/span> dlib<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u5b89\u88c5libboost sudo apt-get install libboost-all-dev \u4ecegithu [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[28],"tags":[],"class_list":["post-13437","post","type-post","status-publish","format-standard","hentry","category-ubuntu"],"_links":{"self":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/13437","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/comments?post=13437"}],"version-history":[{"count":0,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/13437\/revisions"}],"wp:attachment":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/media?parent=13437"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/categories?post=13437"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/tags?post=13437"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}