How to compile caffe on Windows 10

本文提供了一套详细的指南,介绍如何在Windows 10环境下安装配置并编译Caffe深度学习框架。内容包括所需软件的下载安装步骤、Caffe源码的获取与编译流程、以及PyCaffe和MatCaffe的构建方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

http://www.shaneahmed.com/2017/07/how-to-compile-caffe-on-windows-10.html
*UPDATE*: Updated instructions at this link < http://www.shaneahmed.com/2017/07/build-caffe-pycaffe-and-matcaffe-on.html >

Requirements:

Download and install the following software's:
  1. Visual Studio 2015 https://www.visualstudio.com/downloads/
  2. Make 3.4 or higher https://cmake.org/download/
  3. Python 3.5 Anaconda x64 (Required to build pycaffe). https://repo.continuum.io/archive/Anaconda3-4.2.0-Windows-x86_64.exe
  4. CUDA 8.0 https://developer.nvidia.com/accelerated-computing-toolkit
  5. cuDNN v5.1 (optional) https://developer.nvidia.com/cudnn
  6. Matlab (Required to build matcaffe)  http://mathworks.com

Instructions:

Install CUDA v8.0Extract cuDNN folder
  • copy all files from bin folder to 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\bin'
  • similarly from include to 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\include' 
  • and 'lib/x64' to  ''C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\lib/x64'.
Install Anaconda, make sure you select Register Anaconda as system path for Python 3.5Install and activate Matlab using your Matlab licence (only if you need to build matcaffe).Open command window in the desired folder "C:\Projects" (Shift+RightClick and Open Command Window here).Enter the following commands
C:\Projects> git clone https://github.com/BVLC/caffe.git
C:\Projects> cd caffe
C:\Projects\caffe> git checkout windows
Open scripts folder and edit build_win.cmd
  • set path for python and add path to Anaconda folder.
set BUILD_MATLAB=1set -CUDNN_ROOT path to "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0" in cmake configuration in line 146.Edit CMakeLists.txt and make changes according to instructions in  https://github.com/BVLC/caffe/pull /4928/filesEnter following command
C:\Projects\caffe> scripts\build_win.cmd
You can find caffe.exe in C:\Projects\caffe\build\tools\release\caffe.exeEnter
C:\Projects\caffe> call build\libraries\prependpath.bat
Now you should be able to run 
C:\Projects\caffe> build\tools\release\caffe.exe -help

Pycaffe instructions:

Enter the following commands
conda config --add channels conda-forge
conda install ninja --yes
Copy the contents of C:\Projects\caffe\python to [C:\Program Files\Anaconda3\]Lib\site-packages.Now run the following commands:
C:\Projects\caffe> python
>>> import caffe
You should be able to successfully import and run pycaffe.

Matcaffe instructions:

Copy caffe_.mexw64 from C:\Projects\caffe\matlab\+caffe\private\Release\ to C:\Projects\caffe\matlab\+caffe\privateAdd C:\Projects\caffe\build\libraries to Matlab Path using setenv() command.Now you should be able to run demo.m in C:\Projects\caffe\matlab\demo folder.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值