2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

【メモ】caffe インストール

Last updated at Posted at 2016-09-21

■ 関連ライブラリのインストール

sudo apt-get install libatlas-base-dev
sudo apt-get install python-opencv
sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libhdf5-serial-dev
sudo apt-get install --no-install-recommends libboost-all-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
make all
make test
make runset

  • HDF5関係で怒られた場合、Makefile.config と Makefile を修正する

Makefile.config
前:INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include
後:INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial

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

  • Makefile.config の CPU_ONLY のコメントアウトを外す

■ Python で実行するために

make pycaffe

  • caffe のディレクトリで

■ 環境変数の追加

export CAFFE_ROOT=~/caffe
export PYTHONPATH=~/caffe/python/:$PYTHONPATH

■ デモ実行

データセットの用意
sh data/mnist/get_mnist.sh
sh examples/mnist/create_mnist.sh

学習開始
./build/tools/caffe train --solver examples/mnist/lenet_solver.prototxt

  • examples/mnist/lenet_solver.prototxt は solver_mode を GPU から CPU に変更

学習再開
./build/tools/caffe train --solver examples/mnist/lenet_solver.prototxt

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?