The install.sh may exist errors
Opened this issue · 2 comments
I followed the install tutorial, but the caffe can't be installed on my ubuntu. Could you please check the install script of caffe and lib for c++, and give more details about it.
The install.sh given by https://github.com/anhttran/3dmm_cnn/wiki/Installation-Script is only for the first testBatchModel.py. I suggested that the library requirements (Dlib Python and C++ library,
OpenCV Python and C++ library, Caffe (version 1.0.0-rc3 or above required), Numpy, Python2.7) should be installed by yourself.
- I installed the OpenCV3, when running testModel_PoseExpr.py i encountered the error
> Pose & expression estimation
> cannot load TestVisualization
- I found that the fellowing script was not executed
Make build directory (temporary). Make & install to bin folder
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=../bin ..
make
make install
This code should generate TestVisualization
in bin
folder
- When make, the error occured:
/3dmm_cnn/modules/PoseExpr/src/BaselFaceEstimator.cpp: In member function ‘void BaselFaceEstimator::estimatePose3D(cv::Mat, cv::Mat, cv::Mat, cv::Mat&, cv::Mat&)’:
/3dmm_cnn/modules/PoseExpr/src/BaselFaceEstimator.cpp:207:2: error: ‘Rodrigues’ is not a member of ‘cv’
cv::Rodrigues(rMatP, rVec);**
^
Refered to #32 , it's the result of opencv3. So I changed the codes mentioned in CMakeLists.txt line 11 to line 19
In related cpp files, added
#include "opencv2/calib3d.hpp"
#include "opencv/cv.h"
- make again, the error occured when build main.cpp:
/usr/local/include/dlib/gui_core/gui_core_kernel_2.h:11:2: error: #error "DLIB_NO_GUI_SUPPORT is defined so you can't use the GUI code. Turn DLIB_NO_GUI_SUPPORT off if you want to use it."
#error "DLIB_NO_GUI_SUPPORT is defined so you can't use the GUI code.
^
/usr/local/include/dlib/gui_core/gui_core_kernel_22.h:12:2: error: #error "Also make sure you have libx11-dev installed on your system"
#error "Also make sure you have libx11-dev installed on your system"
Since I install Dlib according to http://dlib.net/compile.html, I compiled the Dlib to shared objects again.
Refered to https://stackoverflow.com/questions/33996361/create-a-shared-library-for-dlib.
-After complied the Dlib, there isn't libdlib.so file in the dlib installed path, but in /usr/lib exist the libdlib.so.
Modified the CMakeLists.txtline 5 and 6 as follow
set (DLIB_INCLUDE_DIR "/home/aba/dlib-19.15")
set (DLIB_LIB_DIR "/usr/lib")
and add following lines before line 24
INCLUDE_DIRECTORIES("/usr/local/include")
INCLUDE_DIRECTORIES("/usr/local/include/opencv2")
INCLUDE_DIRECTORIES("/usr/local/include/opencv")
Addinclude_directories(/usr/lib)
to the 3dmm_cnn/modules/PoseExpr/CMakeLists.txt before line4.
- After cmake (delete build directory) , when make new error occured:
/usr/bin/ld: cannot find -lhdf5
collect2: error: ld returned 1 exit status
config/CMakeFiles/TestVisualization.dir/build.make:111: recipe for target 'bin/TestVisualization' failed
make[2]: *** [bin/TestVisualization] Error 1
CMakeFiles/Makefile2:201: recipe for target 'config/CMakeFiles/TestVisualization.dir/all' failed
make[1]: *** [config/CMakeFiles/TestVisualization.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
Then run
cd /usr/lib/x86_64-linux-gnu
sudo ln -s libhdf5_serial.so.10.1.0 libhdf5.so
sudo ln -s libhdf5_serial_hl.so.10.0.2 libhdf5_hl.so
sudo ldconfig
- cmake agian, when make, error:
nvcc fatal : redefinition of argument 'std'
According to similar error, I managed to compile and install by removing OPTIONS -std=c++11 such as add_definitions(-std=c++11)
. But still some thing wrong.
Finally I add OPTIONS -std= c++11, everything goes smoothly. However I don't know the reason.
I also had many problems with make & install. Could you please share the generated TestVisualization so that I can use it to run teatMofel_PoseExpr.py .Thanks a lot.