CUDA安装
- 装好显卡(GTX1070)
- 下载CUDA安装包并安装(用管理员权限打开)
CUDNN安装
- 下载cudnn类包,并解压
- 复制文件到C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0的对应文件夹下
CAFFE安装
- 安装git
- 下载caffe(git clone https://github.com/BVLC/caffe.git)
- git checkout windows
修改%CAFFE_ROOT%\scripts\build_win.cmd文件
……
……
) else (
:: Change the settings here to match your setup
:: Change MSVC_VERSION to 12 to use VS 2013
if NOT DEFINED MSVC_VERSION set MSVC_VERSION=14
:: Change to 1 to use Ninja generator (builds much faster)
if NOT DEFINED WITH_NINJA set WITH_NINJA=0
:: Change to 1 to build caffe without CUDA support
if NOT DEFINED CPU_ONLY set CPU_ONLY=0
:: Change to generate CUDA code for one of the following GPU architectures
:: [Fermi Kepler Maxwell Pascal All]
if NOT DEFINED CUDA_ARCH_NAME set CUDA_ARCH_NAME=Auto
:: Change to Debug to build Debug. This is only relevant for the Ninja generator the Visual Studio generator will generate both Debug and Release configs
if NOT DEFINED CMAKE_CONFIG set CMAKE_CONFIG=Release
:: Set to 1 to use NCCL
if NOT DEFINED USE_NCCL set USE_NCCL=0
:: Change to 1 to build a caffe.dll
if NOT DEFINED CMAKE_BUILD_SHARED_LIBS set CMAKE_BUILD_SHARED_LIBS=0
:: Change to 3 if using python 3.5 (only 2.7 and 3.5 are supported)
if NOT DEFINED PYTHON_VERSION set PYTHON_VERSION=3
:: Change these options for your needs.
if NOT DEFINED BUILD_PYTHON set BUILD_PYTHON=1
if NOT DEFINED BUILD_PYTHON_LAYER set BUILD_PYTHON_LAYER=1
if NOT DEFINED BUILD_MATLAB set BUILD_MATLAB=0
:: If python is on your path leave this alone
if NOT DEFINED PYTHON_EXE set PYTHON_EXE=python
:: Run the tests
if NOT DEFINED RUN_TESTS set RUN_TESTS=0
:: Run lint
if NOT DEFINED RUN_LINT set RUN_LINT=0
:: Build the install target
if NOT DEFINED RUN_INSTALL set RUN_INSTALL=0
)
……
……手动下载libraries_v140_x64_py35_1.1.0.tar(scripts/download_prebuilt_dependencies.py中有具体地址)并保存到C:\Users\%USER_NAME%\.caffe\dependencies\download
- cmd -> cd %CAFFE_ROOT% -> scripts\build_win.cmd
- 看有没有编译错误,%CAFFE_ROOT%\build里文件是否正确生成
PyCaffe配置
- python编译完后,要将caffe_root/python拷贝到python的site路径下。
- pip install google
- pip install protobuf
- python >>> import caffe不报错,就算成功了。
jupyter
- pip install jupyter
- cd %caffe_root%\examples
- jupyter notebook
- 选择要看的*.ipynb示例