caffe 01 win10 运行环境配置(不需要开发环境)
来源:互联网 发布:邓云天觉知视频 编辑:程序博客网 时间:2024/05/29 16:47
01 caffe介绍
Caffe,全称Convolution Architecture For Feature Extraction。caffe是一个清晰,可读性高,快速的深度学习框架。作者是贾扬清,加州大学伯克利的ph.D,现就职于Facebook。
caffe的官网:http://caffe.berkeleyvision.org/。
caffe官方github:https://github.com/BVLC/caffe
官网安装环境介绍页面:http://caffe.berkeleyvision.org/installation.html
官网基础知识介绍页面:http://caffe.berkeleyvision.org/tutorial/
官网实验指导页面:http://caffe.berkeleyvision.org/ 页面中 Examples 中的内容。
windows release 版本下载地址:https://github.com/BVLC/caffe/tree/windows
目前(20170309)共有5个vs2015版本供下载。
Visual Studio 2015, CPU only, Python 3.5: Caffe Release, Caffe Debug
Visual Studio 2015, CUDA 8.0, Python 3.5: Caffe Release Visual
Studio 2015, CPU only, Python 2.7: Caffe Release, Caffe Debug Visual
Studio 2015, CUDA 8.0, Python 2.7: Caffe Release Visual Studio 2013,
CPU only, Python 2.7: Caffe Release, Caffe Debug
本次实验环境:windows10,CUDA8.0,Python3.5.3,
Visual Studio 2015, CUDA 8.0, Python 3.5: Caffe Release
caffe.zip解压到 D:\git\DeepLearning\caffebin
里面有目录:bin、include、lib、python、share。其中python是python接口目录。下载的【Visual Studio 2015, CUDA 8.0, Python 3.5: Caffe Release】 windows
caffe运行版本已经带了vs2015的运行时dll。可以直接在没有安装vs2015的win10机器上运行。如果要在win7或win8.1的运行,需要在win7或win8.1机器上安装vs2015运行文件。
02 安装GPU支持必要组件
下载并安装CUDA8.0。默认安装到C:\Program Files。
网址 https://developer.nvidia.com/cuda-downloads
安装后,会自动生成环境变量
CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0CUDA_PATH_V8_0=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0NVCUDASAMPLES8_0_ROOT=C:\ProgramData\NVIDIA Corporation\CUDA Samples\v8.0NVCUDASAMPLES_ROOT=C:\ProgramData\NVIDIA Corporation\CUDA Samples\v8.0NVTOOLSEXT_PATH=C:\Program Files\NVIDIA Corporation\NvToolsExt\
03 安装pthon3.5.3及必要组件
pytho3.5.3下载地址:https://www.python.org/ftp/python/3.5.3/python-3.5.3-amd64.exe
安装到c:\python35。安装时选择设置环境变量、勾选pip。
安装后,环境变量path中会加入如下两项(如果你安装了其他版本的python,请确保这个环境变量在path的较前位置)。
# %path%环境变量中有如下两行c:\Python35\Scripts\c:\Python35\
安装后,C:\Python35\Lib\site-packages只有README.exe文件。后面使用pip货pip3安装的python组件会被默认安装到
C:\Python35\Lib\site-packages 目录。
根据 https://github.com/BVLC/caffe/tree/windows 官网描述:
Using the Python interface
The recommended Python distribution is Anaconda or Miniconda. To
successfully build the python interface you need to install the
following packages: conda install –yes numpy scipy matplotlib
scikit-image pip sixalso you will need a protobuf python package that is compatible with
pre-built dependencies. This package can be installed this way: conda
install –yes –channel willyd protobuf==3.1.0If Python is installed the default is to build the python interface
and python layers. If you wish to disable the python layers or the
python build use the CMake options -DBUILD_python_layer=0 and
-DBUILD_python=0 respectively. In order to use the python interface you need to either add the C:\Projects\caffe\python folder to your
python path of copy the C:\Projects\caffe\python\caffe folder to
your site_packages folder.
安装必要的python工具组件:
在网址 http://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy
下载scipy-0.18.1-cp35-cp35m-win_amd64.whl
保存到E:\Work\201703\caffe\
安装scipy:
pip3 install E:\Work\201703\caffe\scipy-0.18.1-cp35-cp35m-win_amd64.whl
从 http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy
下载 Numpy+MKL,
选择 numpy-1.11.3+mkl-cp35-cp35m-win_amd64.whl,
下载到E:\Work\201703\caffe\
安装 Numpy+MKL:
pip3 install E:\Work\201703\caffe\numpy-1.11.3+mkl-cp35-cp35m-win_amd64.whl
安装其他组件
pip3 install wheel matplotlib six protobuf scikit-image pydot
这些python组件会被安装在 C:\Python35\Lib\site-packages 目录。
可以使用下列命令查看安装的python组件
pip3 --help # 查看帮助信息pip3 list # 查看已安装的组件pip3 show matplotlib #查看matplotlib 包信息
C:\Python35>pip3 show matplotlib
Name: matplotlib Version: 2.0.0 Summary: Python plotting package
Home-page: http://matplotlib.org Author: John D. Hunter, Michael
Droettboom Author-email: matplotlib-users@python.org License: BSD
Location: c:\python35\lib\site-packages Requires: pytz, pyparsing,
numpy, cycler, six, python-dateutil
04 caffe python接口调用
运行如下test01.py文件。
D:\git\DeepLearning\caffebin\bin\test01.py
import numpy as np;import sys,os;# 注意下面的目录结构,根据自己的实际情况修改即可caffe_root='D:/git/DeepLearning/caffebin/';sys.path.insert(0, caffe_root + 'python');import caffe as ca; # 引入自己的caffe的python接口print("######"); # python打印6个#import matplotlib.pyplot as plt;plt.plot([1,2,3,4], [1,2,3,4]);plt.show(); # 画一条45°直线ca.set_mode_gpu(); #设置使用GPU,ca.set_mode_cpu();# 下面5行验证python目录下的接口可以正常引用import caffe.io as cai;import caffe.net_spec as can;import caffe.classifier as cac;import caffe.draw as cad; # 这个文件需要安装pydot组件import caffe.coord_map as caco;
运行结果:
######WARNING: Logging before InitGoogleLogging() is written to STDERRI0309 14:47:07.974293 27364 common.cpp:36] System entropy source not available, using fallback algorithm to generate seed instead.[Finished in 9.2s]
- caffe 01 win10 运行环境配置(不需要开发环境)
- Caffe 在 win10 环境下配置
- Win10-64位下配置Java开发运行环境
- Win10 配置Python开发环境
- VS2013配置Caffe开发环境
- WIN10 java运行环境的配置
- 【体感】Intel Realsense开发: C++环境配置+语音合成Demo (不需要硬件也能运行)
- Win10系统环境下caffe的Python接口Anaconda2配置
- Deep Learning---win10 搭建caffe开发环境(GPU)
- win10中的VS2013配置OpenCV开发环境
- OpenCV+Qt+Win10开发环境配置
- Win10下Java开发环境配置
- Win10+vs2015+opencv3.20开发环境配置
- OpenCV+Qt+Win10开发环境配置
- C语言开发环境配置(win10)
- Win10下OpenCV3 开发环境配置
- 【caffe学习笔记——cifar10】win10+caffe环境下cifar10运行
- 配置Groovy开发运行环境
- AS混淆打包和多渠道打包总结
- java中的消息转换器--HttpMessageConverter 分类:学习日记
- 利用navicat创建存储过程、触发器和使用游标的简单实例
- 浅谈原生JS和jQuery操作DOM
- 实现下拉框和搜索框一体功能
- caffe 01 win10 运行环境配置(不需要开发环境)
- 【Mysql】Mysql 各个版本区别
- 深入研究Servlet线程安全性问题
- Hadoop:CCAH及CCA系列认证
- Android APP 混淆器使用之二关键词命令
- multipartfile 第二次上传文件为null
- 时间格式转换大全(Data2long,long2Data,String2Data)
- 绝对路径和相对路径
- JS执行与页面加载