win10自带linux+caffe安装记录
公司的server环境都是配好的,mac用brew装也非常方便,因为不能用vpn,要写测试工程,只能用自己的破win10装了,一上午可算捣鼓好了,现在记录一下安装记录。(没装GPU,只是用CPU)
一、win10安装linux
在win10的应用商店搜索linux,会出来ubuntu的应用,安装就好了,具体网上很多,搜一下就好了
二、换apt的源
cd /etc/apt/
sudo cp sources.list back.list
chmod 777 sources.list
然后修改sources.list,敲入
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
##测试版源
deb http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
# 源码
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
##测试版源
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
# Canonical 合作伙伴和附加
deb http://archive.canonical.com/ubuntu/ xenial partner
deb http://extras.ubuntu.com/ubuntu/ xenial main
然后更新源
sudo apt-get update
三、安装依赖
可参照caffe官网http://caffe.berkeleyvision.org/install_apt.html
sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libhdf5-serial-dev protobuf-compiler
sudo apt-get install --no-install-recommends libboost-all-dev
sudo apt-get install libopenblas-dev # 这里用的openblas
四、安装caffe
从git上随便拉一个就好
改Makefile.cfg
注意修改INCLUDE_DIRS,LIBRARY_DIRS(hdf5的问题,不改编就会出现问题)
#INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial/
#LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib /usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/hdf5/serial
用cpu的话,CPU_ONLY注释去掉
用python的话,把WITH_PYTHON_LAYER注释去掉
五、编译
make -j
如果用python接口
make pycaffe