VMware14&&Ubuntu16&&caffe(matcaffe&pycaffe)(CPU)

VMware14 下载安装

VMware Workstation Pro v14.0下载及永久激活密钥

FF31K-AHZD1-H8ETZ-8WWEZ-WUUVA

Ubuntu16虚拟机安装

略过

分配空间不少于35G

安装matlab

 Ubuntu 16.04安装Matlab 2016b教程

便于启动

sudo apt-get install matlab-support

安装caffe

安装依赖

sudo apt-get install libatlas-base-dev
sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libboost-all-dev libhdf5-serial-dev
sudo apt-get install libgflags-dev libgoogle-glog-dev liblmdb-dev protobuf-compiler

准备caffe

git clone https://github.com/BVLC/caffe.git
cd caffe
cp Makefile.config.example Makefile.config
使用文本编辑器打开Makefile.config,因为这里没有配置GPU,所以去掉CPU_ONLY := 1前面的注释;
由于Ubuntu16.04文件结构的变化,#Whatever else you find you need goes here.处要改成下面这样:
# Whatever else you find you need goes here.  
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial  
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib /usr/lib/x86_64-linux-gnu/hdf5/serial  

修改matlab路径

# This is required only if you will compile the matlab interface.
# MATLAB directory should contain the mex binary in /bin.
MATLAB_DIR := /usr/local/MATLAB/R2016b

安装python依赖

cd python
apt-get install python-pip  
for req in $(cat requirements.txt); do pip install $req; done
sudo apt-get install python-numpy

编译

make -j
make pycaffe
make matcaffe

修改mattest error

root@test222:/matlab/r2016a/bin/glnxa64# mv libopencv_imgproc.so.2.4 libopencv_imgproc.so.2.4.bak
root@test222:/matlab/r2016a/bin/glnxa64# mv libopencv_highgui.so.2.4 libopencv_highgui.so.2.4.bak
root@test222:/matlab/r2016a/bin/glnxa64# mv libopencv_core.so.2.4 libopencv_core.so.2.4.bak

root@test222:/matlab/r2016a/bin/glnxa64# ln /usr/lib/x86_64-linux-gnu/libopencv_core.so.2.4.9 libopencv_core.so.2.4
root@test222:/matlab/r2016a/bin/glnxa64# ln /usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4.9 libopencv_highgui.so.2.4
root@test222:/matlab/r2016a/bin/glnxa64# ln /usr/lib/x86_64-linux-gnu/libopencv_imgproc.so.2.4.9 libopencv_imgproc.so.2.4

添加路径

vim ~/.bashrc
#matcaffe
export LD_PRELOAD=$LD_PRELOAD:/usr/lib/x86_64-linux-gnu/libstdc++.so.6:/usr/lib/x86_64-linux-gnu/libprotobuf.so.9
#pycaffe
export PYTHONPATH="~/caffe/python" 

source ~/.bashrc

https://github.com/BVLC/caffe/issues/3934

https://github.com/BVLC/caffe/issues/5447

update

编译内存不足:

http://vb2005xu.iteye.com/blog/2171295
主要原因大体上是因为内存不足,有点坑 临时使用交换分区来解决吧
sudo dd if=/dev/zero of=/swapfile bs=64M count=16
sudo mkswap /swapfile
sudo swapon /swapfile
After compiling, you may wish to
Code:
sudo swapoff /swapfile

sudo rm /swapfile

Linux下matlab打开出现启动桌面时错误

sudo chmod -R a+rw ~/.matlab

Invalid MEX-file "caffe_.mexa" 的解决方法

https://blog.csdn.net/shaoxiaohu1/article/details/51411301

sudo rm /usr/local/Matlab/R2013a/sys/os/glnxa64/libstdc++.so.6
sudo ln -s /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /usr/local/Matlab/R2013a/sys/os/glnxa64/libstdc++.so.6 

matlab解决低级图形问题

软件 OpenGL - 在 MATLAB 命令提示符处键入 opengl('save','software')。然后,重新启动 MATLAB。


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值