Ubuntu 14 Caffe安裝(無GPU)
前提
已經安裝好Anaconda、opencv2.4.8以及dlib
正文
- 安裝依賴庫(一):
$ 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
- 安裝BLAS:
$ sudo apt-get install libatlas-base-dev
可以安裝OpenBLAS 或 MKL,以提升CPU效能,但是要修改caffe中Makefile檔案…
- 安裝依賴庫(二):
$ sudo apt-get install libgflags-dev libgoogle-glog-dev liblmdb-dev
- 下載Caffe
$ cd ~
$ git clone git://github.com/BVLC/caffe.git
- 編譯Caffe
$ cd ~/caffe
$ cp Makefile.config.example Makefile.config
- 修改Makefile.config檔案:去掉CPU_ONLY:= 1的註釋
$ make all
$ make test
$ make runtest
存在問題解決
安裝glog/gflags/lmdb
- 安裝glog
wget https://google-glog.googlecode.com/files/glog-0.3.3.tar.gz
tar zxvf glog-0.3.3.tar.gz
cd glog-0.3.3
./configure
make
sudo make install
- 安裝gflags
wget https://github.com/schuhschuh/gflags/archive/master.zip
unzip master.zip
cd gflags-master
mkdir build && cd build
export CXXFLAGS="-fPIC" && cmake .. && make VERBOSE=1
make
sudo make install
- 安裝lmdb
git clone https://github.com/LMDB/lmdb
cd lmdb/libraries/liblmdb
make
sudo make install
- 安裝glog
glog安裝由於無google訪問許可權,需離線下載安裝就好
make sudo make install
- 安裝lmdb
runtest報錯:../../build/examples/lenet/convert_mnist_data.bin: error while loading shared libraries: libglog.so.0: cannot open shared object file: No such file or directory
解決,在runtest之前修改路徑如下:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
配置pycaffe
- 安裝依賴庫:
$ sudo apt-get install python-numpy python-scipy python-matplotlib python-sklearn python-skimage python-h5py python-protobuf python-leveldb python-networkx python-nose python-pandas python-gflags Cython ipython
$ sudo apt-get install protobuf-c-compiler protobuf-compiler
- 編譯
$ cd ~/caffe
$ make pycaffe
- 新增~/caffe/Python到$PYTHONPATH:
$ sudo gedit /etc/profile
- 末尾新增:
export PYTHONPATH=/實際path/caffe/python:$PYTHONPATH
$ source /etc/profile
- 測試是否可以引用:
$ python
Python 2.7.6 (default, Jun 22 2015, 17:58:13)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import caffe
相關文章
- Ubuntu 16.04 下安裝配置caffeUbuntu
- Ubuntu 16.04 安裝 Tensorflow Gpu版本UbuntuGPU
- ubuntu16+tensorflow-gpu安裝cudaUbuntuGPU
- 在Ubuntu 18.04安裝tensorflow 1.12 GPU版本UbuntuGPU
- 超順 | Ubuntu16 安裝配置aws gpuUbuntuGPU
- 滴滴雲GPU雲伺服器Ubuntu系統安裝Ubuntu桌面GPU伺服器Ubuntu
- Ubuntu16.04不用管理員許可權安裝caffe依賴(上)Ubuntu
- 如何在Ubuntu 18.04伺服器上安裝TensorFlow(Nvidia GPU)Ubuntu伺服器GPU
- Ubuntu 安裝 tensorflow-gpu 1.4 +CUDA 8.0 +cuDNN詳細教程UbuntuGPUDNN
- 在Ubuntu 20.04中安裝Nvidia V100 GPU驅動UbuntuGPU
- 【MindSpore】Ubuntu16.04上成功安裝GPU版MindSpore1.0.1UbuntuGPU
- ubuntu 20.04安裝GCC G++ 6.2,支援c++ 14UbuntuGCC++
- (14)caffe總結之Linux下Caffe如何除錯Linux除錯
- tensorflow-gpu 安裝GPU
- 安裝 UbuntuUbuntu
- ubuntu安裝Ubuntu
- Ubuntu解除安裝和安裝Ubuntu
- Torch GPU版本的安裝GPU
- Tensorflow GPU版本安裝教程GPU
- Pytorch的GPU版本安裝PyTorchGPU
- docker安裝tensorflow-gpuDockerGPU
- 如何解決windows無法安裝ubuntu問題WindowsUbuntu
- Ubuntu 16 04 編譯 Caffe SSDUbuntu編譯
- Ubuntu 安裝 ImagickUbuntu
- ubuntu 安裝tsensorUbuntu
- ubuntu工具安裝Ubuntu
- Ubuntu安裝APMServerUbuntuServer
- ubuntu安裝dockerUbuntuDocker
- ubuntu 安裝 rosUbuntuROS
- 【ubuntu】安裝MavenUbuntuMaven
- Ubuntu安裝gitUbuntuGit
- nginx ubuntu 安裝NginxUbuntu
- Ubuntu硬碟安裝Ubuntu硬碟
- Ubuntu安裝KubernetesUbuntu
- Ubuntu安裝nodejsUbuntuNodeJS
- ubuntu安裝CMakeUbuntu
- Ubuntu 安裝WPSUbuntu
- ubuntu 安裝 dockerUbuntuDocker
- ubuntu安裝MySQLUbuntuMySql