python3.5 caffe(2017.8) cuda8.0 cudnn5.1 VS2015(windows)

来源:互联网 发布:好看的男装淘宝店 编辑:程序博客网 时间:2024/05/21 06:21

CUDA安装

  1. 装好显卡(GTX1070)
  2. 下载CUDA安装包并安装(用管理员权限打开)

CUDNN安装

  1. 下载cudnn类包,并解压
  2. 复制文件到C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0的对应文件夹下

CAFFE安装

  1. 安装git
  2. 下载caffe(git clone https://github.com/BVLC/caffe.git)
  3. git checkout windows
  4. 修改%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
    )
    ……
    ……

  5. 手动下载libraries_v140_x64_py35_1.1.0.tar(scripts/download_prebuilt_dependencies.py中有具体地址)并保存到C:\Users\%USER_NAME%\.caffe\dependencies\download

  6. cmd -> cd %CAFFE_ROOT% -> scripts\build_win.cmd
  7. 看有没有编译错误,%CAFFE_ROOT%\build里文件是否正确生成

PyCaffe配置

  1. python编译完后,要将caffe_root/python拷贝到python的site路径下。
  2. pip install google
  3. pip install protobuf
  4. python >>> import caffe不报错,就算成功了。

jupyter

  1. pip install jupyter
  2. cd %caffe_root%\examples
  3. jupyter notebook
  4. 选择要看的*.ipynb示例
阅读全文
0 0
原创粉丝点击