Error Reporting Solution in Caffe Installation

The process of installing Caffe is not difficult. According to the official tutorial, there are still some problems. Solutions and records are as follows.

Detail

Error message:

1
2
src/caffe/util/benchmark.cpp:1:53: fatal error: boost/date_time/posix_time/posix_time.hpp:
No such file or directory

Solution:
Searched for this article, including a paragraph

このサイトを参考にして、libboostとやらをインストールしてみる。

In the StackOverFlowof This example,
Try

1
sudo apt-get install --no-install-recommends libboost-all-dev

Solved.

Error message:

1
./include/caffe/util/hdf5.hpp:6:18: fatal error: hdf5.h: No such file or directory

Solution:
see here
Excerpts are as follows:

>
Fix hdf5 naming problem

Your machine may report the following error when compiling Caffe even though libhdf5-serial-dev package has been already installed in it.

./include/caffe/util/hdf5.hpp:6:18: fatal error: hdf5.h: No such file or directory

This is because of change of default path and name of hdf5 head files and libraries in Ubuntu 15.10. To solve this problem, we can simply modify Makefile files.

Append /usr/include/hdf5/serial/ to INCLUDE_DIRS at line 85 in Makefile.config.

— INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include

+++ INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial/

Modify hdf5_hl and hdf5 to hdf5_serial_hl and hdf5_serial at line 173 in 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

We get error message “no module named caffe” when importing caffe, Obviously,missing “make pycaffe” and “make distribute”.

Error message:

1
Import error:libcaffe.so.1.0.0-rc5:no such file or directory

Solution:

Edit PYTHONPATH in .bashrc

1
2
3
export CAFFE_ROOT=/home/symeonchen/caffe/caffe
export PYTHONPATH=/home/symeonchen/caffe/caffe/distribute/python:$PYTHONPATH
export PYTHONPATH=/home/symeonchen/caffe/caffe/python:$PYTHONPATH

Error message:

1
ImportError: No module named skimage.io

so:

1
pip install scikit-image