Requirements:
Ubuntu 14/16
GPU 2GB/1.5GB (nvidia-smi view memory)
2GB RAM
8 core CPU
Very Important:
If you install the CUDA8 ubuntu14/16:
I. Needs: CUDA, CUDNN, OpenCV, Atlas
1.OpenCV:
sudo apt-get install Libopencv-dev
If OpenCV3 has been installed, modify the related makefile and change the corresponding line to: # Opencv_version: = 3
A opencv_contrib module is required. Installation method:
cmake-d cmake_build_type=release-d cmake_install_prefix=/usr/local-d Opencv_extra_modules_path=<path to Opencv_ Contrib/modules/>..
For example:
And then:
MAKE-J7
sudo make install
And in the makefile of libraries + = Opencv_core Opencv_highgui Opencv_imgproc finally plus Opencv_contrib
3.Atlas:
sudo apt-get install Libatlas-base-dev
You can also install Openblas or inter MKL and change blas: = Atlas to the appropriate.
two. Installation of Caffe and Openpose
chmod u+x install_caffe_and_openpose.sh
./install_caffe_and_openpose.sh
If you want to use CUDA7, install Caffe:
CD 3rdparty/caffe/# Select your desired file (run only one of the next 4 Makefile) CP Makefile.config.Ubuntu14_cuda_7.example Makefile.config # Ubuntu, CUDA 7 CP Makefile.config.Ubuntu14.example
Makefile.config # ubuntu, Cuda 8 cp Makefile.config.Ubuntu16_cuda_7.example Makefile.config # ubuntu, Cuda 7 CP Makefile.config.Ubuntu16.example Makefile.config # Ubuntu, cuda 8 # Change any custom flag from the resulting
Makefile.config (e.g. OpenCV 3, ATLAS/OPENBLAS/MKL, etc.) # Compile Caffe make All-j${number_of_cpus} && make Distribute-j${number_of_cpus}
### Install openpose ###
CD. /.. /models/
./getmodels.sh # It Just downloads the Caffe trained
CD ...
# Same file CP command as the one used for Caffe
CP Makefile.config.Ubuntu14_cuda_7.example makefile.config
# Chan GE any custom flag from the resulting makefile.config (e.g. OpenCV 3, ATLAS/OPENBLAS/MKL, etc.)
Make All-j${number_of_cpus}
If you want to use your own caffe, install it according to the custom Caffe method.
If you need to modify something, please:
Make clean make
all-j$ (num_cores)
Tip:
There are altogether 2 makefile.config.ubuntu##.example, one of them in the ... In/3rdparty/caffe/, the configuration file in which the changes to two files are changed: OpenCV 3 flag, ATLAB/OPENBLAS/MKL flag, etc.
re-modified methods:
Make-Clean && CD-3rdparty/caffe && Make-clean
The
is then regenerated.
problem Record:
1. Appears:
Cxx/ld-o. Build_release/tools/convert_imageset.bin
. Build_release/lib /libcaffe.so:undefined reference to Cv::imread (cv::string const&, int) '. build_release/lib/libcaffe.so:undefined Reference Tocv::imencode (cv::string const&, Cv::_inputarray Const&, std::vector >&, std::vector > const&) '
. build_release/lib/libcaffe.so:undefined reference to ' Cv::imdecode (Cv::_inputarray const&, int '
Collect2:error:ld returned 1 exit status
Make: * [. build_release/tools/convert_imageset.bin] Error 1
Solution:add "Opencv_imgcodecs" in Makefile. (Libraries + glog gflags protobuf leveldb snappy/lmdb boost_system hdf5_hl hdf5 m \ Opencv_core Opencv_highgui opencv_i Mgproc opencv_imgcodecs) If you input ' make all ', the problem is the same again. But If you delete all the file in Build (RM-RF./build/*) before ' Make all ' (I use ' make clean '), you'll success. I just success GitHub discussion post: https://github.com/BVLC/caffe/issues/2348 ps:build/lib/libcaffe.a (IMAGE_IO.O): in function Caffe::readvideotovolumedatum (char const*, int, int, int, int, int, int, caffe::volumedatum*) ': Image_io.cpp: (. text+ 0x1905): Undefined reference tocv::videocapture::videocapture () ' Image_io.cpp: (. Text+0x1abe): undefined reference to Cv::videocapture::open (cv::string const&) ' Image_io.cpp: (. text+0x1ace): Undefined reference tocv::videocapture: : isopened () const ' Image_io.cpp: (. text+0x1c91): Undefined reference to Cv::videocapture::~videocapture () ' Image_ Io.cpp: (. text+0x1d22): undefined reference tocv::videocapture::gET (int) const ' Image_io.cpp: (. text+0x1d6d): Undefined reference to Cv::videocapture::set (int, double) ' Image_io.cpp: (. TEXT+0X1DE1): Undefined reference tocv::videocapture::set (int, double) ' Image_io.cpp: (. text+0x1e35): undefined Reference to Cv::videocapture::read (Cv::_outputarray const&) ' Image_io.cpp: (. text+0x1f7e): undefined reference Tocv::videocapture::release () ' Image_io.cpp: (. text+0x1fc3): Undefined reference to Cv::videocapture::read (cv::_
Outputarray const&) ' Image_io.cpp: (. text+0x22e9): Undefined reference-tocv::videocapture::~videocapture () ' Collect2:error:ld returned 1 exit status Make: * * * [Build/tools/blob_proto_to_blob_binary.bin] Error 1 Make: * * * waiting
For unfinished jobs .... Same solution by adding opencv_videoio into libraries in the Makefile
Similar problems, the solution is the same.
2. Opencv_contrib not found:
Replace it with some of the modules
3. Appearance:
/home/usrname/opencv-3.0.0/modules/cudalegacy/src/graphcuts.cpp:120:54:error: ' NppiGraphcutState ' has not been Declared
typedef nppstatus (init_func_t) (Nppisize osize, nppigraphcutstate* ppstat
/home/usrname/opencv-3.0.0/modules/cudalegacy/src/graphcuts.cpp:135:18:error: ' NppiGraphcutState ' does not name a Type
Operator nppigraphcutstate* ()
/home/usrname/opencv-3.0.0/modules/cudalegacy/src/graphcuts.cpp:141:9: Error: ' Nppigraphcutstate ' does not name a Type
Nppigraphcutstate* pstate;
Solution: Refer to my other blog:
http://blog.csdn.net/yeluohanchan/article/details/75267438
4. Appearance:
Fatal error:hdf5.h: No file or directory:
/opencv3.1.0/opencv_contrib/modules/hdf/include/opencv2/hdf/hdf5.hpp
Put
#include
To
#include </usr/include/hdf5/serial/hdf5.h>
5. Operation Error:
./build/examples/openpose/rtpose.bin:error while loading shared libraries:libopencv_core.so.3.1:cannot open shared Object File:no such file or directory
Workaround:
sudo ldconfig