Tag Archives: Caffe

Mac OS error in make pycaffe times failure error:’python.h’file not found resolved

After installing caffe, report the following error when executing Make Pycaffe in caffe/build:

 linxierdeAir:caffe linxier$ cd build
linxierdeAir:build linxier$ make pycaffe
[  1%] Built target caffeproto
[ 98%] Built target caffe
[ 98%] Building CXX object python/CMakeFiles/pycaffe.dir/caffe/_caffe.cpp.o
/Users/linxier/caffe/python/caffe/_caffe.cpp:1:10: fatal error: 'Python.h' file
      not found
#include <Python.h>  // NOLINT(build/include_alpha)
         ^~~~~~~~~~
1 error generated.
make[3]: *** [python/CMakeFiles/pycaffe.dir/caffe/_caffe.cpp.o] Error 1
make[2]: *** [python/CMakeFiles/pycaffe.dir/all] Error 2
make[1]: *** [python/CMakeFiles/pycaffe.dir/rule] Error 2
make: *** [pycaffe] Error 2

Solutions:

Export CPLUS_INCLUDE_PATH =/System/Library/Frameworks/Python framework Versions/2.7/include/python2.7

Reference links: https://stackoverflow.com/questions/35778495/fatal-error-python-h-file-not-found-while-installing-opencv
the path name to your computer contains Python. H folder path, after successful compilation.

[Caffe] fatal error: hdf5.h: No such file or directory error solution

This error occurs when installing Caffe while compiling to source code if it is not in accordance with HDF5

sudo apt-get install libhdf5-dev

If an error is still reported after installation, open makefile.config, go to INCLUDE_DIRS and add /usr/include/hdf5/ Serial after it, as follows:

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

LIBRARY_DIRS, then add /usr/lib/ x86_64-Linux-gnu /hdf5/serial, as follows:

LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib /usr/lib/x86_64-linux-gnu/hdf5/serial

Re-execute make All.

caffe deep learning [three] compilation error: fatal error: hdf5.h: No such file or directory compilation terminated.

Question:
When configuring Caffe-SSD today, I was ready to compile Caffe when I encountered:

fatal error: hdf5.h: No such file or directory compilation terminated.

Such problems are shown in the following figure:

The reason is that the header file for HDF5.h was not found.
 
 
 
 
 
 
Solutions:
1. Modify makefile.config file
Go to the download directory for Caffe
In the makefile.config file, hold down CRTL + F to search: INCLUDE_DIRS
Note that it’s not makefile.config. example!!
Add/usr/include/hdf5/serial/to INCLUDE_DIRS
Namely, the original:

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

Now it’s:

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

 
 
2. Modify the Makefile file
In the Makefile file, press and hold CRTL + F to search: LIBRARIES +=
Note that this is not the makefile.config from step 1 above!!
Change HDF5_HL and HDF5 to HDF5_SERIal_HL and HDF5_serial.
Namely, the original:

LIBRARIES += glog gflags protobuf boost_system boost_filesystem m hdf5_hl hdf5

Now it’s:

LIBRARIES += glog gflags protobuf boost_system boost_filesystem m hdf5_serial_hl hdf5_serial

 
 
 
 
Results: