git clone https://github.com/runhang/caffe-ssd.git
cd caffe-ssd
if !PYTHON_VERSION! EQU 2 ( set CONDA_ROOT=C:\Anaconda2 ) :: Set python 3.5 with conda as the default python if !PYTHON_VERSION! EQU 3 ( set CONDA_ROOT=C:\Anaconda2\envs\py3 )
:: Configure using cmake and using the caffe-builder dependencies :: Add -DCUDNN_ROOT=C:/Projects/caffe/cudnn-8.0-windows10-x64-v5.1/cuda ^ :: below to use cuDNN cmake -G"!CMAKE_GENERATOR!" ^ -DBLAS=Open ^ -DCMAKE_BUILD_TYPE:STRING=%CMAKE_CONFIG% ^ -DBUILD_SHARED_LIBS:BOOL=%CMAKE_BUILD_SHARED_LIBS% ^ -DBUILD_python:BOOL=%BUILD_PYTHON% ^ -DBUILD_python_layer:BOOL=%BUILD_PYTHON_LAYER% ^ -DBUILD_matlab:BOOL=%BUILD_MATLAB% ^ -DCPU_ONLY:BOOL=%CPU_ONLY% ^ -DCOPY_PREREQUISITES:BOOL=1 ^ -DINSTALL_PREREQUISITES:BOOL=1 ^ -DUSE_NCCL:BOOL=!USE_NCCL! ^ -DCUDA_ARCH_NAME:STRING=%CUDA_ARCH_NAME% ^ -DCUDNN_ROOT=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\cuda ^
-C "D:\tyang\caffe-builder\build_v140_x64\libraries\caffe-builder-config.cmake" ^ "%~dp0\.."
(上面粉紅色部分就是第三方庫的文件位置,根據本身的位置改下,不加上這句的話默認在user/.caffe下)python
('v140', '3.6')
set(DEPENDENCIES_VERSION 1.1.0) set(DEPENDENCIES_NAME_1800_27 libraries_v120_x64_py27_${DEPENDENCIES_VERSION}) set(DEPENDENCIES_NAME_1900_27 libraries_v140_x64_py27_${DEPENDENCIES_VERSION}) set(DEPENDENCIES_NAME_1900_36 libraries_v140_x64_py35_${DEPENDENCIES_VERSION}) set(DEPENDENCIES_URL_BASE https://github.com/willyd/caffe-builder/releases/download) set(DEPENDENCIES_FILE_EXT .tar.bz2) set(DEPENDENCIES_URL_1800_27 "${DEPENDENCIES_URL_BASE}/v${DEPENDENCIES_VERSION}/${DEPENDENCIES_NAME_1800_27}${DEPENDENCIES_FILE_EXT}") set(DEPENDENCIES_SHA_1800_27 "ba833d86d19b162a04d68b09b06df5e0dad947d4") set(DEPENDENCIES_URL_1900_27 "${DEPENDENCIES_URL_BASE}/v${DEPENDENCIES_VERSION}/${DEPENDENCIES_NAME_1900_27}${DEPENDENCIES_FILE_EXT}") set(DEPENDENCIES_SHA_1900_27 "17eecb095bd3b0774a87a38624a77ce35e497cd2") set(DEPENDENCIES_URL_1900_36 "${DEPENDENCIES_URL_BASE}/v${DEPENDENCIES_VERSION}/${DEPENDENCIES_NAME_1900_35}${DEPENDENCIES_FILE_EXT}") set(DEPENDENCIES_SHA_1900_36 "f060403fd1a7448d866d27c0e5b7dced39c0a607")
find_package(PythonInterp 3.6)
(就是上面粉紅色部分得第三方庫)git
git clone https://github.com/willyd/caffe-builder.git cd caffe-builder
修改 build_v140_x64.cmdgithub
確保cmake在電腦環境目錄裏windows
build_v140_x64.cmd
速度可能有點慢,並且要下載。。。ui
回到第一步(如需添加新層,也要從這裏開始)spa
scripts\build_win.cmd
過程當中會報錯:libraries_v140_x64_py35_1.1.0.tar下載失敗3d
手動下載: 地址code
而後重命名 .tar.bz2 放到 C:\Users\tyang\.caffe\dependencies\downloadblog
再試一次接口
上面編譯完會生成一個build文件夾,裏面就是VS工程了
用VS2015打開選擇Release生成ALL_BUILD
將 caffe-ssd\python添加到環境目錄
將 caffe-ssd\python\caffe 拷貝到 python所在\Lib\site-packages