您的位置:首页 > 编程语言 > MATLAB

caffe-windows cpu下编译python接口/matlab接口

2017-07-20 09:51 549 查看
1.下载caffe-windwos:https://github.com/BVLC/caffe/tree/windows

2.修改scripts/build_win.cmd:

64行以后::: 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=1

    :: 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=1

    :: 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

3.dos下,运行scripts/build_win.cmd

4.pycaffe:将运行完成后的python目录下caffe目录拷贝到:C:\Python35\Lib\site-packages

5.matlab:将caffe-windows\matlab\+caffe\private\Release目录下的caffe_.mexw64拷贝到caffe-windows\matlab\+caffe\private,并在matlab软件里设置路径:caffe-windows\matlab。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: