关于 Tensorflow1.12版本下安装dlib问题
首先报错cmake那就直接安装cmake
pip install cmake
后面安装过程中dlib流程
pip install dlib
出现错误错误
ERROR: Command errored out with exit status 1:
command: 'D:\Anaconda\envs\tf112_gpu\python.exe' -u -c 'import io, os, sys, setuptools, tokeniz
e; sys.argv[0] = '"'"'C:\\Users\\22806\\AppData\\Local\\Temp\\pip-install-2nygs424\\dlib_e6855c04a
5f74ea3ac23a4556b35337d\\setup.py'"'"'; __file__='"'"'C:\\Users\\22806\\AppData\\Local\\Temp\\pip-
install-2nygs424\\dlib_e6855c04a5f74ea3ac23a4556b35337d\\setup.py'"'"';f = getattr(tokenize, '"'"'
open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools impor
t setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compil
e(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\22806\AppData\Local\Temp\pip-wheel-mlxuar50'
cwd: C:\Users\22806\AppData\Local\Temp\pip-install-2nygs424\dlib_e6855c04a5f74ea3ac23a4556b35337d\
Complete output (318 lines):
running bdist_wheel
running build
running build_py
package init file 'tools\python\dlib\__init__.py' not found (or not a regular file)
running build_ext
Building extension for Python 3.6.13 |Anaconda, Inc.| (default, Mar 16 2021, 11:37:27) [MSC v.1916 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\Users\22806\AppData\Local\Temp\pip-install-2nygs424\dlib_e6855c0
4a5f74ea3ac23a4556b35337d\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\22806\AppData\Loc
al\Temp\pip-install-2nygs424\dlib_e6855c04a5f74ea3ac23a4556b35337d\build\lib.win-amd64-3.6 -DPYTHO
N_EXECUTABLE=D:\Anaconda\envs\tf112_gpu\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Use
rs\22806\AppData\Local\Temp\pip-install-2nygs424\dlib_e6855c04a5f74ea3ac23a4556b35337d\build\lib.win-amd64-3.6 -A x64'
-- Building for: Visual Studio 17 2022
-- Selecting Windows SDK version 10.0.22000.0 to target Windows 10.0.22621.
-- The C compiler identification is MSVC 19.34.31937.0
-- The CXX compiler identification is MSVC 19.34.31937.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.34.31933/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.34.31933/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PythonInterp: D:/Anaconda/envs/tf112_gpu/python.exe (found version "3.6.13")
-- Found PythonLibs: D:/Anaconda/envs/tf112_gpu/libs/Python36.lib
-- pybind11 v2.2.4
-- Using CMake version: 3.25.2
-- Compiling dlib version: 19.24.0
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of void*
-- Check size of void* - done
-- Enabling SSE2 instructions
-- Searching for BLAS and LAPACK
-- Searching for BLAS and LAPACK
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - not found
-- Found Threads: TRUE
-- Found CUDA: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v9.0 (found suitable version "9.0", minimum required is "7.5")
-- Looking for cuDNN install...
-- Found cuDNN: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v9.0/lib/x64/cudnn.lib
-- Building a CUDA test project to see if your compiler is compatible with CUDA...
-- *****************************************************************************************************************
-- *** CUDA was found but your compiler failed to compile a simple CUDA program so dlib isn't going to use CUDA.
-- *** The output of the failed CUDA test compile is shown below:
-- ***
-- *** Change Dir: C:/Users/22806/AppData/Local/Temp/pip-install-2nygs424/dlib_e6855c04a5f74ea3ac23a4556b35337d/build/temp.win-amd64-3.6/Release/dlib_build/cuda_test_build
***
*** Run Build Command(s):C:/Program Files/Microsoft Visual Studio/2022/Community/MSBuild/Cu
rrent/Bin/amd64/MSBuild.exe ALL_BUILD.vcxproj /p:Configuration=Debug /p:Platform=x64 /p:VisualStudioVersion=17.0 /v:m && MSBuild version 17.4.1+9a89d02ff for .NET Framework
*** C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Micro
soft.CppBuild.targets(527,5): warning MSB8029: 涓\xad闂寸洰褰曟垨杈撳嚭鐩\xae褰曟棤娉曢┗鐣欏湪涓存
鐩\xae褰曚笅锛屽洜涓鸿繖鍙\xaf鑳戒細瀵艰嚧澧為噺鐢熸垚鍑虹幇闂\xae棰樸\x80\x82 [C:\Users\22806\A A
ppData\Local\Temp\pip-install-2nygs424\dlib_e6855c04a5f74ea3ac23a4556b35337d\build\temp.win-amd64-3.6\Release\dlib_build\cuda_test_build\ZERO_CHECK.vcxproj]
*** Checking Build System
*** C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Micro
soft.CppBuild.targets(527,5): warning MSB8029: 涓\xad闂寸洰褰曟垨杈撳嚭鐩\xae褰曟棤娉曢┗鐣欏湪涓存
鐩\xae褰曚笅锛屽洜涓鸿繖鍙\xaf鑳戒細瀵艰嚧澧為噺鐢熸垚鍑虹幇闂\xae棰樸\x80\x82 [C:\Users\22806\A A
ppData\Local\Temp\pip-install-2nygs424\dlib_e6855c04a5f74ea3ac23a4556b35337d\build\temp.win-amd64-3.6\Release\dlib_build\cuda_test_build\cuda_test.vcxproj]
*** Building NVCC (Device) object CMakeFiles/cuda_test.dir/Debug/cuda_test_generated_cuda_test.cu.obj
*** cuda_test.cu
*** C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\include\crt/host_config.h(133):
fatal error C1189: #error: -- unsupported Microsoft Visual Studio version! Only the versions 201
2, 2013, 2015 and 2017 are supported! [C:\Users\22806\AppData\Local\Temp\pip-install-2nygs424\dlib
_e6855c04a5f74ea3ac23a4556b35337d\build\temp.win-amd64-3.6\Release\dlib_build\cuda_test_build\cuda_test.vcxproj]
*** CUSTOMBUILD : nvcc warning : The -std=c++11 flag is not supported with the configured h
ost compiler. Flag will be ignored. [C:\Users\22806\AppData\Local\Temp\pip-install-2nygs424\dlib_e
6855c04a5f74ea3ac23a4556b35337d\build\temp.win-amd64-3.6\Release\dlib_build\cuda_test_build\cuda_test.vcxproj]
*** CMake Error at cuda_test_generated_cuda_test.cu.obj.Debug.cmake:216 (message):
*** Error generating
*** C:/Users/22806/AppData/Local/Temp/pip-install-2nygs424/dlib_e6855c04a5f74ea3ac23a45
56b35337d/build/temp.win-amd64-3.6/Release/dlib_build/cuda_test_build/CMakeFiles/cuda_test.dir//Debug/cuda_test_generated_cuda_test.cu.obj
***
***
*** C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Micro
soft.CppCommon.targets(247,5): error MSB8066: 鈥淐:\Users\22806\AppData\Local\Temp\pip-install-2ny
gs424\dlib_e6855c04a5f74ea3ac23a4556b35337d\dlib\cmake_utils\test_for_cuda\cuda_test.cu;C:\Users\2
2806\AppData\Local\Temp\pip-install-2nygs424\dlib_e6855c04a5f74ea3ac23a4556b35337d\dlib\cmake_util
s\test_for_cuda\CMakeLists.txt鈥濈殑鑷\xaa瀹氫箟鐢熸垚宸查\x80\x80鍑猴紝浠g爜涓\xba 1銆\x82 [C:\U
sers\22806\AppData\Local\Temp\pip-install-2nygs424\dlib_e6855c04a5f74ea3ac23a4556b35337d\build\temp.win-amd64-3.6\Release\dlib_build\cuda_test_build\cuda_test.vcxproj]
***
***
-- *****************************************************************************************************************
-- Disabling CUDA support for dlib. DLIB WILL NOT USE CUDA
-- C++11 activated.
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/22806/AppData/Local/Temp/pip-install-2nygs424/dlib_e6855c04a5f74ea3ac23a4556b35337d/build/temp.win-amd64-3.6/Release
Invoking CMake build: 'cmake --build . --config Release -- /m'
MSBuild version 17.4.1+9a89d02ff for .NET Framework
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppB
uild.targets(527,5): warning MSB8029: 中间目录或输出目录无法驻留在临时目录下,因为这可能会导致增量
成出现问题。 [C:\Users\22806\AppData\Local\Temp\pip-install-2nygs424\dlib_e6855c04a5f74ea3ac23a4 4556b35337d\build\temp.win-amd64-3.6\Release\ZERO_CHECK.vcxproj]
Checking Build System
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppB
uild.targets(527,5): warning MSB8029: 中间目录或输出目录无法驻留在临时目录下,因为这可能会导致增量
成出现问题。 [C:\Users\22806\AppData\Local\Temp\pip-install-2nygs424\dlib_e6855c04a5f74ea3ac23a4 4556b35337d\build\temp.win-amd64-3.6\Release\dlib_build\dlib.vcxproj]
Building Custom Rule C:/Users/22806/AppData/Local/Temp/pip-install-2nygs424/dlib_e6855c04a5f74ea3ac23a4556b35337d/dlib/CMakeLists.txt
base64_kernel_1.cpp
bigint_kernel_1.cpp
bigint_kernel_2.cpp
bit_stream_kernel_1.cpp
entropy_decoder_kernel_1.cpp
entropy_decoder_kernel_2.cpp
entropy_encoder_kernel_1.cpp
entropy_encoder_kernel_2.cpp
md5_kernel_1.cpp
tokenizer_kernel_1.cpp
unicode.cpp
test_for_odr_violations.cpp
sockets_kernel_1.cpp
bsp.cpp
dir_nav_kernel_1.cpp
dir_nav_kernel_2.cpp
dir_nav_extensions.cpp
fonts.cpp
linker_kernel_1.cpp
extra_logger_headers.cpp
logger_kernel_1.cpp
logger_config_file.cpp
misc_api_kernel_1.cpp
misc_api_kernel_2.cpp
sockets_extensions.cpp
sockets_kernel_2.cpp
sockstreambuf.cpp
sockstreambuf_unbuffered.cpp
server_kernel.cpp
server_iostream.cpp
server_http.cpp
multithreaded_object_extension.cpp
threaded_object_extension.cpp
threads_kernel_1.cpp
threads_kernel_2.cpp
threads_kernel_shared.cpp
thread_pool_extension.cpp
async.cpp
timer.cpp
stack_trace.cpp
cpu_dlib.cpp
tensor_tools.cpp
image_dataset_metadata.cpp
mnist.cpp
cifar.cpp
global_function_search.cpp
kalman_filter.cpp
auto.cpp
widgets.cpp
drawable.cpp
canvas_drawing.cpp
style.cpp
base_widgets.cpp
gui_core_kernel_1.cpp
gui_core_kernel_2.cpp
png_loader.cpp
save_png.cpp
jpeg_loader.cpp
save_jpeg.cpp
arm_init.c
filter_neon_intrinsics.c
png.c
pngerror.c
pngget.c
pngmem.c
pngpread.c
pngread.c
pngrio.c
pngrtran.c
pngrutil.c
pngset.c
pngtrans.c
pngwio.c
pngwrite.c
pngwtran.c
pngwutil.c
adler32.c
compress.c
crc32.c
deflate.c
gzclose.c
gzlib.c
gzread.c
gzwrite.c
infback.c
inffast.c
inflate.c
C:\Users\22806\AppData\Local\Temp\pip-install-2nygs424\dlib_e6855c04a5f74ea3ac23a4556b35337d\dli
b\external\zlib\gzread.c(319,17): warning C4267: “=”: 从“size_t”转换到“unsigned int”,可能丢失数据
[C:\Users\22806\AppData\Local\Temp\pip-install-2nygs424\dlib_e6855c04a5f74ea3ac23a4556b35337d\buiild\temp.win-amd64-3.6\Release\dlib_build\dlib.vcxproj]
C:\Users\22806\AppData\Local\Temp\pip-install-2nygs424\dlib_e6855c04a5f74ea3ac23a4556b35337d\dli
b\external\zlib\gzread.c(400,11): warning C4267: “=”: 从“size_t”转换到“unsigned int”,可能丢失数据
[C:\Users\22806\AppData\Local\Temp\pip-install-2nygs424\dlib_e6855c04a5f74ea3ac23a4556b35337d\buiild\temp.win-amd64-3.6\Release\dlib_build\dlib.vcxproj]
C:\Users\22806\AppData\Local\Temp\pip-install-2nygs424\dlib_e6855c04a5f74ea3ac23a4556b35337d\dli
b\external\zlib\gzread.c(472,11): warning C4267: “=”: 从“size_t”转换到“int”,可能丢失数据 [C:\User
s\22806\AppData\Local\Temp\pip-install-2nygs424\dlib_e6855c04a5f74ea3ac23a4556b35337d\build\temp.win-amd64-3.6\Release\dlib_build\dlib.vcxproj]
C:\Users\22806\AppData\Local\Temp\pip-install-2nygs424\dlib_e6855c04a5f74ea3ac23a4556b35337d\dli
b\external\zlib\gzwrite.c(212,24): warning C4267: “=”: 从“size_t”转换到“unsigned int”,可能丢失数
据 [C:\Users\22806\AppData\Local\Temp\pip-install-2nygs424\dlib_e6855c04a5f74ea3ac23a4556b35337d\build\temp.win-amd64-3.6\Release\dlib_build\dlib.vcxproj]
C:\Users\22806\AppData\Local\Temp\pip-install-2nygs424\dlib_e6855c04a5f74ea3ac23a4556b35337d\dli
b\external\zlib\gzwrite.c(232,21): warning C4267: “=”: 从“size_t”转换到“unsigned int”,可能丢失数
据 [C:\Users\22806\AppData\Local\Temp\pip-install-2nygs424\dlib_e6855c04a5f74ea3ac23a4556b35337d\build\temp.win-amd64-3.6\Release\dlib_build\dlib.vcxproj]
C:\Users\22806\AppData\Local\Temp\pip-install-2nygs424\dlib_e6855c04a5f74ea3ac23a4556b35337d\dli
b\external\zlib\gzwrite.c(371,11): warning C4267: “=”: 从“size_t”转换到“int”,可能丢失数据 [C:\Use
rs\22806\AppData\Local\Temp\pip-install-2nygs424\dlib_e6855c04a5f74ea3ac23a4556b35337d\build\temp.win-amd64-3.6\Release\dlib_build\dlib.vcxproj]
inftrees.c
trees.c
uncompr.c
zutil.c
jaricom.c
jcapimin.c
jcapistd.c
jcarith.c
jccoefct.c
jccolor.c
jcdctmgr.c
jchuff.c
jcinit.c
jcmainct.c
jcmarker.c
jcmaster.c
jcomapi.c
jcparam.c
jcprepct.c
jcsample.c
jdapimin.c
jdapistd.c
jdarith.c
jdatadst.c
jdatasrc.c
jdcoefct.c
本质上是版本问题所以对于我tf112版本来说 安装
pip install dlib==19.8.1