zoukankan      html  css  js  c++  java
  • Dlib支持CPU指令集编译问题(SSE4.2或者AVX)

    The compile script is:

    mkdir build
    cd build
    cmake ../../tools/python -DUSE_SSE2_INSTRUCTIONS=ON
    cmake --build . --config Release --target install 
    cd ..

    You forgot the -D. So you have to say, cmake -DUSE_SSE2_INSTRUCTIONS=ON(-DUSE_SSE2_INSTRUCTIONS=0)

    cmake ../../tools/python -DUSE_SSE4_INSTRUCTIONS=OFF
    cmake ../../tools/python -DUSE_SSE2_INSTRUCTIONS=ON
    python setup.py install --yes USE_AVX_INSTRUCTIONS --yes USE_SSE2_INSTRUCTIONS --yes USE_SSE4_INSTRUCTIONS
    只安装基于SSE2指令集的Dlib包:
    python3.6 setup.py build --no USE_AVX_INSTRUCTIONS --yes USE_SSE2_INSTRUCTIONS --no USE_SSE4_INSTRUCTIONS
    CMake编译用: -DUSE_SSE4_INSTRUCTIONS=OFF
    python setup.py build 编译用: --no USE_SSE4_INSTRUCTIONS

    for Python 3 support use:

    python setup.py install --yes DPYTHON3

    I just ran into this and it was because the python module was being compiled with SSE4 instructions but my CPU only supports SSE2. Open tools/python/CMakeLists.txt and edit the line:

    set(USE_SSE4_INSTRUCTIONS ON CACHE BOOL "Use SSE4 instructions")
    In my case I changed it to:
    set(USE_SSE2_INSTRUCTIONS ON CACHE BOOL "Use SSE2 instructions")


    版本1(默认版本):

    git clone https://github.com/davisking/dlib.git    //Clone the code from github
    cd dlib
    mkdir build
    cd build
    cmake .. -DDLIB_USE_CUDA=0 -DUSE_AVX_INSTRUCTIONS=1 //以AVX指令的方式编译dlib
    cmake --build .
    cd ..
    sudo python setup.py install --yes USE_AVX_INSTRUCTIONS --no DLIB_USE_CUDA

    注:最后一步需要等待一些时间。如果使用python3.x版本,最后一步命令python改为python3

    版本2(版本1不成功,请试下版本2):

    git clone https://github.com/davisking/dlib.git //Clone the code from github
    cd dlib
    mkdir build
    cd build
    cmake ..                        //以默认方式(SSE41指令)编译dlib
    cmake --build .
    cd ..
    sudo python setup.py install

    注:最后一步需要等待一些时间。如果使用python3.x版本,最后一步命令python改为python3

    酒是穿肠毒药,色是刮骨钢刀,财是惹祸根苗,气是雷烟火炮。 不过,无酒毕竟不成席,无色世上人渐稀,无财何人早早起,无气处处惹人欺。 饮酒不醉量为高,见色不迷真英豪,不义之财君莫取,忍气饶人祸自消。 酒色财气四堵墙,人人都在里边藏,谁若跳到墙外边,不是神仙也寿长。 君听我一言:做人,量体裁衣。
  • 相关阅读:
    120所国家重点建设大学(211工程和教育部直属)[国家一类本科大学]详细情况一览表
    VC画线几个常见方法
    中国地学35个国家重点实验室分布一览
    可执行文件加入Linux默认路径的办法
    SVN 常用命令 客户端
    ls(list) linux 功能说明
    Vim
    Linux添加FTP用户并设置权限
    tar [cxtzjvfpPN] 文件与目录
    linux etc/passwd 有关
  • 原文地址:https://www.cnblogs.com/laosan007/p/11738200.html
Copyright © 2011-2022 走看看