使用git命令将github上caffe最新的代码下载下来。 (1)安装git:
sudo add-apt -repository ppa:git-core /ppa
sudo apt-get update
sudo apt-get install git
查看版本信息:
- -
(2)下载源代码:
git clone https:
2. caffe配置
在源码的第一层目录中,有一个文件Makefile.config.example
。首先进行文件拷贝:
cp Makefile.config .example Makefile.config
然后对Makefile.config
进行修改:
USE_CUDNN : = 1
CPU_ONLY : = 1
OPENCV_VERSION : = 3
PYTHON_INCLUDE : = /usr/include /python2.7 \
/usr /lib/python 3.5 /dist-packages/numpy/core/include
3.caffe编译
j代表多线程编译。
make all -j8
make alltest -j8
编译python版本的caffe
make pycaffe
然后配置一下环境变量:
$sudo gedit ~/.bashrc
添加: export PYTHONPATH=/path/to/caffe/python:$PYTHONPATH
$sudo source ~/.bashrc
4.问题
1.error: hdf5.h: No such file or directory
解决方案:将/usr/include/hdf5/serial
添加到文件Makefile.config的INCLUDE_DIRS
中
INCLUDE_DIRS : = $( PYTHON_INCLUDE ) /usr/local/include
修改为:
INCLUDE_DIRS : = $( PYTHON_INCLUDE ) /usr/local/include /usr/include /hdf5/serial/
但是待会会出现一个新的错误,找不到-lhdf5
和-lhdf5_hl
文件。
修改Makefile文件:
LIBRARIES + = glog gflags protobuf boost_system boost_filesystem m hdf5_hl hdf5
修改为:
LIBRARIES + = glog gflags protobuf boost_system boost_filesystem m hdf5_serial_hl hdf5_serial
2.如果是虚拟环境的话,如何配置python?
修改Makefile.config:
PYTHON_INCLUDE : = /usr/include /python2.7 \
/usr /lib/python 3.5 /dist-packages/numpy/core/include
修改为:
PYTHON_INCLUDE : = .env/versions/env270 /include /python2.7 \
.env/versions/env270 /lib/python2.7 /dist-packages/numpy/core/include
其中路径前缀需要根据自己实际的环境进行配置。
PYTHON_LIB: =/usr/lib
修改为:
PYTHON_LIB: =.env /versions/env270/lib
版权声明:转载请注明出处 http://blog.youkuaiyun.com/TwT520Ly https://blog.youkuaiyun.com/TwT520Ly/article/details/80445432
(".MathJax").remove(); MathJax.Hub.Config({ "HTML-CSS": { linebreaks: { automatic: true, width: "94%container" }, imageFont: null }, tex2jax: { preview: "none" }, mml2jax: { preview: 'none' } }); (function(){ var btnReadmore =
(".MathJax").remove(); MathJax.Hub.Config({ "HTML-CSS": { linebreaks: { automatic: true, width: "94%container" }, imageFont: null }, tex2jax: { preview: "none" }, mml2jax: { preview: 'none' } }); (function(){ var btnReadmore =
("#btn-readmore"); if(btnReadmore.length>0){ var winH =
( w i n d o w ) . h e i g h t ( ) ; v a r a r t i c l e B o x =
(
w
i
n
d
o
w
)
.
h
e
i
g
h
t
(
)
;
v
a
r
a
r
t
i
c
l
e
B
o
x
=
("div.article_content"); var artH = articleBox.height(); if(artH > winH*2){ articleBox.css({ 'height':winH*2+'px', 'overflow':'hidden' }) btnReadmore.click(function(){ articleBox.removeAttr("style"); $(this).parent().remove(); }) }else{ btnReadmore.parent().remove(); } } })()
老中医说:饭后用一物,体重瘦到90斤! 塑业商贸 · 顶新
var width = $("div.recommend-box").outerWidth() - 48; NEWS_FEED({ w: width, h : 90, showid : 'GNKXx7', placeholderId: "ad1", inject : 'define', define : { imagePosition : 'left', imageBorderRadius : 0, imageWidth: 120, imageHeight: 90, imageFill : 'clip', displayImage : true, displayTitle : true, titleFontSize: 20, titleFontColor: '#333', titleFontFamily : 'Microsoft Yahei', titleFontWeight: 'bold', titlePaddingTop : 0, titlePaddingRight : 0, titlePaddingBottom : 10, titlePaddingLeft : 16, displayDesc : true, descFontSize: 14, descPaddingLeft: 14, descFontColor: '#6b6b6b', descFontFamily : 'Microsoft Yahei', paddingTop : 0, paddingRight : 0, paddingBottom : 0, paddingLeft : 0, backgroundColor: '#fff', hoverColor: '#ca0c16' } })
老中医说:男人多吃它,性生活时间延长5倍 国瑞兴邦 · 顶新
var width = $("div.recommend-box").outerWidth() - 48; NEWS_FEED({ w: width, h: 90, showid: 'Afihld', placeholderId: 'a_d_feed_0', inject: 'define', define: { imagePosition: 'left', imageBorderRadius: 0, imageWidth: 120, imageHeight: 90, imageFill: 'clip', displayImage: true, displayTitle: true, titleFontSize: 20, titleFontColor: '#333', titleFontFamily: 'Microsoft Yahei', titleFontWeight: 'bold', titlePaddingTop: 0, titlePaddingRight: 0, titlePaddingBottom: 10, titlePaddingLeft: 16, displayDesc: true, descFontSize: 14, descPaddingLeft: 14, descFontColor: '#6b6b6b', descFontFamily: 'Microsoft Yahei', paddingTop: 0, paddingRight: 0, paddingBottom: 0, paddingLeft: 0, backgroundColor: '#fff', hoverColor: '#ca0c16' } })
# Contributions si…
u010598445
2016-11-12 11:42:29
阅读数:2250
scrolling="no">
id="iframeu3394176_0" src="https://pos.baidu.com/bcqm?conwid=800&conhei=100&rdid=3394176&dc=3&di=u3394176&dri=0&dis=0&dai=7&ps=4457x662&enu=encoding&dcb=___adblockplus&dtm=HTML_POST&dvi=0.0&dci=-1&dpt=none&tsr=0&tpr=1531185127055&ti=%E3%80%90Caffe%E3%80%91Linux%E9%85%8D%E7%BD%AEPycaffe%20-%20优快云%E5%8D%9A%E5%AE%A2&ari=2&dbv=0&drs=3&pcs=1908x636&pss=1908x4560&cfv=0&cpl=0&chi=4&cce=true&cec=UTF-8&tlm=1531185127&prot=2&rw=636<u=https%3A%2F%2Fblog.youkuaiyun.com%2Ftwt520ly%2Farticle%2Fdetails%2F80445432&ecd=1&uc=1920x988&pis=-1x-1&sr=1920x1080&tcn=1531185127&qn=f9ea1af9c21b8517&tt=1531185126735.599.599.599" vspace="0" hspace="0" scrolling="no" width="800" height="100" align="center,center">
个人资料
等级:
访问:
4万+
积分:
1579
排名:
3万+
scrolling="no" src="https://pos.baidu.com/s?hei=250&wid=300&di=u3392637<u=https%3A%2F%2Fblog.youkuaiyun.com%2Ftwt520ly%2Farticle%2Fdetails%2F80445432&cmi=0&par=1920x988&ps=478x346&cdo=-1&cja=false&psr=1920x1080&pis=-1x-1&ant=0&ari=2&cfv=0&dai=1&dis=0&dc=3&cec=UTF-8&exps=111000&dtm=HTML_POST&ccd=24&pcs=1908x636&prot=2&drs=1&cce=true&pss=1908x3482&dri=0&col=zh-CN&ti=%E3%80%90Caffe%E3%80%91Linux%E9%85%8D%E7%BD%AEPycaffe%20-%20优快云%E5%8D%9A%E5%AE%A2&chi=4&tlm=1531185127&cpl=0&tpr=1531185127010&tcn=1531185127" width="300" height="250">
<div id="asideNewArticle" class="aside-box">
<h3 class="aside-title">最新文章</h3>
<div class="aside-content">
<ul class="inf_list clearfix csdn-tracking-statistics tracking-click" data-mod="popu_382">
<li class="clearfix">
<a href="https://blog.youkuaiyun.com/TwT520Ly/article/details/80969523" target="_blank">【C++学习】C++多线程初步入门---thread库</a>
</li>
<li class="clearfix">
<a href="https://blog.youkuaiyun.com/TwT520Ly/article/details/80949854" target="_blank">【OpenMP】多线程计算过程中任务调度问题</a>
</li>
<li class="clearfix">
<a href="https://blog.youkuaiyun.com/TwT520Ly/article/details/80924224" target="_blank">【C++学习】C++实现高效内存池</a>
</li>
<li class="clearfix">
<a href="https://blog.youkuaiyun.com/TwT520Ly/article/details/80909552" target="_blank">【神经网络】神经网络加速之量化模型</a>
</li>
<li class="clearfix">
<a href="https://blog.youkuaiyun.com/TwT520Ly/article/details/80908688" target="_blank">【Neon】配置Android Studio错误</a>
</li>
</ul>
</div>
<div class="aside-box">
<div id="_4lk99zcha1q"><div style="width:0px;height:0px;margin-bottom:0px;"></div><iframe scrolling="no" src="https://pos.baidu.com/s?hei=250&wid=300&di=u3392638&ltu=https%3A%2F%2Fblog.youkuaiyun.com%2Ftwt520ly%2Farticle%2Fdetails%2F80445432&dc=3&chi=4&ari=2&ant=0&cja=false&prot=2&drs=1&cce=true&pss=1908x3482&cpl=0&par=1920x988&dai=2&col=zh-CN&tcn=1531185127&exps=111000&dis=0&tpr=1531185127010&cmi=0&psr=1920x1080&ps=2146x346&cec=UTF-8&tlm=1531185127&pcs=1908x636&ti=%E3%80%90Caffe%E3%80%91Linux%E9%85%8D%E7%BD%AEPycaffe%20-%20优快云%E5%8D%9A%E5%AE%A2&dtm=HTML_POST&ccd=24&cfv=0&cdo=-1&dri=0&pis=-1x-1" width="300" height="250" frameborder="0"></iframe></div><script type="text/javascript" src="//cee1.iteye.com/mhzzpwgzj.js"></script>
</div>
<div class="aside-box">
<div class="persion_article">
<div class="right_box footer_box csdn-tracking-statistics" data-mod="popu_475" data-dsm="post"> <h3 class="feed_new_tit"><span class="line"></span><span class="txt">联系我们</span></h3> <div class="contact-box"> <div class="img-box"><img src="//csdnimg.cn/pubfooter/images/csdn_cs_qr.png" alt="客服"></div> <div class="contact-info"> <h4>请扫描二维码联系客服</h4> <p><svg width="16" height="16" xmlns="http://www.w3.org/2000/svg"><path d="M2.167 2h11.666C14.478 2 15 2.576 15 3.286v9.428c0 .71-.522 1.286-1.167 1.286H2.167C1.522 14 1 13.424 1 12.714V3.286C1 2.576 1.522 2 2.167 2zm-.164 3v1L8 10l6-4V5L8 9 2.003 5z" fill="#B3B3B3" fill-rule="evenodd"></path></svg><a href="mailto:webmaster@youkuaiyun.com" target="_blank"><span class="txt">webmaster@youkuaiyun.com</span></a></p><p><svg width="16" height="16" xmlns="http://www.w3.org/2000/svg"><path d="M14.999 13.355a.603.603 0 0 1-.609.645H1.61a.603.603 0 0 1-.609-.645l.139-1.47c.021-.355.25-.845.51-1.088 0 0 3.107-2.827 3.343-2.909 0 0-.029-2.46 1.2-2.46h3.635c1.112 0 1.202 2.469 1.202 2.469l3.32 2.9c.26.243.489.733.51 1.088l.139 1.47zM7 10a1 1 0 0 0 0 2h2a1 1 0 0 0 0-2H7zm7.806-5.674c.105.135.191.384.19.554l-.003 2.811c0 .17-.133.26-.295.2l-2.462-.999a.478.478 0 0 1-.296-.416V5.445c0-2.07-7.878-2.225-7.878 0v1.21c0 .17-.135.352-.3.404L1.3 7.904c-.165.052-.3-.044-.3-.213V4.88c0-.17.086-.42.191-.554C1.191 4.326 2.131 2 8 2s6.807 2.326 6.807 2.326z" fill="#B3B3B3"></path></svg><span class="txt"> 400-660-0108</span></p> <p><svg width="16" height="16" xmlns="http://www.w3.org/2000/svg"><path d="M14.496 10.35c-.301-1.705-1.565-2.822-1.565-2.822.18-1.548-.481-1.823-.481-1.823C12.31.915 8.089.998 8 1 7.91.998 3.689.915 3.55 5.705c0 0-.662.275-.481 1.823 0 0-1.264 1.117-1.565 2.822 0 0-.16 2.882 1.445.353 0 0 .36.96 1.022 1.823 0 0-1.183.392-1.083 1.412 0 0-.04 1.136 2.527 1.058 0 0 1.805-.137 2.347-.882h.476c.542.745 2.347.882 2.347.882 2.566.078 2.527-1.058 2.527-1.058.1-1.02-1.083-1.412-1.083-1.412a7.986 7.986 0 0 0 1.022-1.823c1.604 2.529 1.445-.353 1.445-.353z" fill="#B3B3B3" fill-rule="evenodd"></path></svg><a href="javascript:void(0);" class="qqcustomer_s" target="_blank"><span class="txt">QQ客服</span></a> <svg width="16" height="16" xmlns="http://www.w3.org/2000/svg"><path d="M7.325 13.965a6.5 6.5 0 1 1 7.175-6.4C14.467 11.677 11.346 15 7.5 15c-.514 0-1.015-.06-1.498-.172.488-.178.922-.48 1.323-.863zM4 7.5a4 4 0 1 0 8 0 .5.5 0 1 0-1 0 3 3 0 1 1-6 0 .5.5 0 0 0-1 0z" fill="#B3B3B3" fill-rule="evenodd"></path></svg><a href="http://bbs.youkuaiyun.com/forums/Service" target="_blank"><span class="txt">客服论坛</span></a> </p> </div></div> <div class="bg-gray"> <div class="feed_copyright"> <p><a class="right-dotte" href="//www.youkuaiyun.com/company/index.html#about" target="_blank">关于</a><a href="//www.youkuaiyun.com/company/index.html#recruit" target="_blank" class="right-dotte">招聘</a><a href="//www.youkuaiyun.com/company/index.html#business" target="_blank" class="right-dotte">广告服务</a> <a href="https://www.youkuaiyun.com/gather/A" target="_blank" class="footer_baidu"> 网站地图</a></p> <p class="fz12">©2018 优快云版权所有 <a href="http://www.miibeian.gov.cn/" target="_blank" class="ml14">京ICP证09002463号</a></p> <p class="fz12 fz12_baidu"><svg width="13" height="14" xmlns="http://www.w3.org/2000/svg"><path d="M8.392 7.013c1.014 1.454 2.753 2.8 2.753 2.8s1.303 1.017.47 2.98c-.833 1.962-3.876.942-3.876.942s-1.122-.36-2.424-.072c-1.303.291-2.426.181-2.426.181s-1.523.037-1.957-1.888c-.434-1.927 1.52-2.982 1.666-3.161.145-.183 1.159-.873 1.81-1.963.653-1.09 2.608-1.962 3.984.181zm1.23 5.706V9.346H8.64v2.534h-.937s-.3-.044-.356-.285V9.33l-.925.015v2.518s.042.627.925.855h2.277zm-3.685.013V7.951l-.896-.014v1.295H3.987s-1.054.086-1.422 1.28c-.129.798.114 1.266.156 1.368.043.099.383.682 1.238.852h1.978zm-2.433-1.45c-.087-.286.013-.613.057-.741.042-.128.228-.427.61-.54h.855v1.948h-.797s-.555-.029-.725-.668zm6.877-8.775c-.143.909-.865 2.108-1.99 1.962-1.121-.144-1.375-1.16-1.267-2.179C7.214 1.458 8.21.18 9.007.364c.796.18 1.52 1.235 1.374 2.143zm-4.09-.345c0 1.197-.68 2.164-1.52 2.164S3.25 3.36 3.25 2.162C3.25.967 3.932 0 4.77 0c.842 0 1.52.967 1.52 2.162zm4.854 2.09c1.34 0 1.701 1.309 1.701 1.743 0 .438.182 2.29-1.485 2.326-1.667.037-1.737-1.126-1.737-1.96 0-.874.179-2.11 1.52-2.11zm-7.93.581c.045.398.253 2.217-1.27 2.544C.427 7.704-.14 5.947.028 5.124c0 0 .18-1.78 1.412-1.89.98-.085 1.7.986 1.774 1.6z" fill="#999" fill-rule="evenodd"></path></svg><em>百度提供支持</em></p> </div> <div class="allow-info-box"> <p><a href="http://www.hd315.gov.cn/beian/view.asp?bianhao=010202001032100010" target="_blank"><span>经营性网站备案信息</span></a></p> <p><a href="http://www.cyberpolice.cn/" target="_blank"><span>网络110报警服务</span></a></p> <p><a href="http://www.12377.cn/" target="_blank"><span>中国互联网举报中心</span></a></p> <p><a href="http://www.bjjubao.org/" target="_blank"><span>北京互联网违法和不良信息举报中心</span></a></p> </div> </div> </div></div>
</div>
</div>
("a.flexible-btn").click(function(){
("a.flexible-btn").click(function(){
(this).parents('div.aside-box').removeClass('flexible-box'); $(this).remove(); })