I recently installed the installation of the old version of Caffe, the installation process is really two words "want to die", so my mistakes are generally more classic.
Couldn't find hdf5.h
It's easy to find common solutions on the Web:
---include_dirs: = $ (python_include)/usr/local/INCLUDE+ + + include_dirs: = $ (python_include)/usr/local/ include/usr/include/hdf5/serial/---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
But the old version of the Caffe really is very good, even if it has been changed or can not find, then the heart is the WTF
I found this on GitHub, and the big God is all over GitHub, and all the hdf5.h header files have been changed.
https://github.com/BVLC/caffe/issues/2690
diff--git A/makefile.config.example b/Makefile.config.exampleindex a873502. 33441B3100644---A/Makefile.config.example+ + + bmakefile.config.example@@- -,7+ -,7@@ Python_lib: =/usr/Lib # WhateverElseYouFindYou need goes. Include_dirs:= $ (python_include)/usr/local/include-library_dirs: = $ (python_lib)/usr/local/lib/usr/Lib+library_dirs: = $ (python_lib)/usr/local/lib/usr/lib/usr/lib/x86_64-linux-gnu/hdf5/Serial # If Homebrew is installed at a non forExample your home directory) and use it forGeneral Dependencies # Include_dirs+ = $ (Shell brew--prefix)/includediff--git a/include/caffe/data_layers.hpp b/include/caffe/Data_layers.hppindex 3958cb7. 2CCBAEC100644---a/include/caffe/data_layers.hpp+ + b/include/caffe/data_layers.hpp@@-6,7+6,7@@ ZZFCTHOTFIXZ<vector>#include"boost/scoped_ptr.hpp"-#include"hdf5.h"+ #include"hdf5/serial/hdf5.h"#include"caffe/blob.hpp"#include"caffe/common.hpp"diff--git a/include/caffe/util/io.hpp b/include/caffe/util/Io.hppindex 3a62c3c. F4363f0100644---a/include/caffe/util/io.hpp+ + b/include/caffe/util/io.hpp@@-5,8+5,8@@ ZZFCTHOTFIXZ<string>#include"google/protobuf/message.h"-#include"hdf5.h"-#include"hdf5_hl.h"+ #include"hdf5/serial/hdf5.h"+ #include"hdf5/serial/hdf5_hl.h"#include"caffe/blob.hpp"#include"caffe/common.hpp"diff--git A/src/caffe/layers/hdf5_data_layer.CPPB/src/caffe/layers/hdf5_data_layer.CPPIndex 8A782F7: 42890be100644---a/src/caffe/layers/hdf5_data_layer.CPP+ + + B/src/caffe/layers/hdf5_data_layer.CPP@@ -Ten,8+Ten,8@@ TODO: #include<string>#include<vector>-#include"hdf5.h"-#include"hdf5_hl.h"+ #include"hdf5/serial/hdf5.h"+ #include"hdf5/serial/hdf5_hl.h"#include"stdint.h"#include"caffe/data_layers.hpp"diff--git a/src/caffe/layers/hdf5_data_layer.cu b/src/caffe/layers/Hdf5_data_layer.cuindex 5e3e4ce. 23bc02a100644---a/src/caffe/layers/hdf5_data_layer.cu+ + b/src/caffe/layers/hdf5_data_layer.cu@@-7,8+7,8@@ TODO: #include<string>#include<vector>-#include"hdf5.h"-#include"hdf5_hl.h"+ #include"hdf5/serial/hdf5.h"+ #include"hdf5/serial/hdf5_hl.h"#include"caffe/data_layers.hpp"#include"caffe/layer.hpp"diff--git A/src/caffe/layers/hdf5_output_layer.CPPB/src/caffe/layers/hdf5_output_layer.CPPIndex f63375c: 0B57EB9100644---a/src/caffe/layers/hdf5_output_layer.CPP+ + + B/src/caffe/layers/hdf5_output_layer.CPP@@ -1,7+1,7@@ ZZFCTHOTFIXZ<vector>-#include"hdf5.h"-#include"hdf5_hl.h"+ #include"hdf5/serial/hdf5.h"+ #include"hdf5/serial/hdf5_hl.h"#include"caffe/blob.hpp"#include"caffe/common.hpp"diff--git a/src/caffe/layers/hdf5_output_layer.cu b/src/caffe/layers/Hdf5_output_layer.cuindex ae497c3. ada682f100644---a/src/caffe/layers/hdf5_output_layer.cu+ + b/src/caffe/layers/hdf5_output_layer.cu@@-1,7+1,7@@ ZZFCTHOTFIXZ<vector>-#include"hdf5.h"-#include"hdf5_hl.h"+ #include"hdf5/serial/hdf5.h"+ #include"hdf5/serial/hdf5_hl.h"#include"caffe/blob.hpp"#include"caffe/common.hpp"
And then there's the can ' t find features when it's used
Before the silly pull of a few pip Isntall features results and no eggs, so downloaded
Https://github.com/cvondrick/pyvision/blob/master/vision/features.pyx
To compile it separately
Cython-a features.pyxgcc -shared-pthread-fpic-fwrapv-o2-wall-fno-strict-aliasing -i/usr/include/python2. 7 -o features.so features.c
Finally, refer to the features path before the required code, such as I put features in the Vision file, add a sentence to the start of the py file
Sys.path = ['/home/hu/pyvision/vision'] + sys.path
The Narray and image objects were found to be incompatible when invoking the program, so I wrote a translator between the PIL and the array.
def Array2pil (arr, size=[96,96]): 'RGBA' = Arr.reshape (arr.shape[0]*arr.shape[1], arr.shape[2]) if len (arr[0]) = =3 : = Np.c_[arr, 255*np.ones ((Len (arr), 1), np.uint8)] return'Raw ', mode, 0, 1)
The final program can run, and the code looks pretty much the same.
The lucky God always favors the hard-working people, refuels
Caffe UBUNTU16 Installation Error and procedure summary