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
酒是穿肠毒药,色是刮骨钢刀,财是惹祸根苗,气是雷烟火炮。
不过,无酒毕竟不成席,无色世上人渐稀,无财何人早早起,无气处处惹人欺。
饮酒不醉量为高,见色不迷真英豪,不义之财君莫取,忍气饶人祸自消。
酒色财气四堵墙,人人都在里边藏,谁若跳到墙外边,不是神仙也寿长。
君听我一言:做人,量体裁衣。