From 17692c4c76c9617ee306d30d7c2c69c883f53988 Mon Sep 17 00:00:00 2001 From: Kaju-Bubanja Date: Tue, 7 Aug 2018 10:43:42 +0200 Subject: [PATCH 1/3] Added missing dependecies --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5e37ee3..9b8fcf1 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,11 @@ If you find PoseCNN useful in your research, please consider citing: - [boost](https://www.boost.org/) - [Sophus](https://github.com/strasdat/Sophus) - [nanoflann](https://github.com/jlblancoc/nanoflann) - - libsuitesparse-dev + - [nlopt](https://nlopt.readthedocs.io/en/latest/) + - libsuitesparse-dev(apt install) + - openexr(apt install) + - libopenexr-dev(apt install) + We use Boost.Python library to link tensorflow with the c++ code. Make sure you have it in your Boost. The tested Boost version is 1.66.0. From 7e0c5b307befe262193a18f4704411d5b892847d Mon Sep 17 00:00:00 2001 From: Kaju-Bubanja Date: Fri, 10 Aug 2018 10:35:34 +0200 Subject: [PATCH 2/3] Updated install instructions --- README.md | 71 ++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 49 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 9b8fcf1..1d40724 100644 --- a/README.md +++ b/README.md @@ -25,35 +25,53 @@ If you find PoseCNN useful in your research, please consider citing: ### Installation -1. Install [TensorFlow](https://www.tensorflow.org/get_started/os_setup). I usually compile the source code of tensorflow locally. +1. Install [TensorFlow](https://www.tensorflow.org/get_started/os_setup) version r1.8 from source binaries won't work because of ABI incompatibilities. + 1. Make a virtualenv with and add these packages, otherwise tf can not be build by source: pip install mock keras Cython easydict transforms3d(the last two are needed for later to actually run the demo) -2. Compile the new layers under $ROOT/lib we introduce in PoseCNN. - ```Shell - cd $ROOT/lib - sh make.sh - ``` -3. Download the VGG16 weights from [here](https://drive.google.com/open?id=1UdmOKrr9t4IetMubX-y-Pcn7AVaWJ2bL) (528M). Put the weight file vgg16.npy to $ROOT/data/imagenet_models. +2. Download the VGG16 weights from [here](https://drive.google.com/open?id=1UdmOKrr9t4IetMubX-y-Pcn7AVaWJ2bL) (528M). Put the weight file vgg16.npy to $ROOT/data/imagenet_models. + +3. Get dependencies: sudo apt-get install libsuitesparse-dev openexr libopenexr-dev metis libmetis-dev + +4. Compile lib/kinect_fusion to be able to compile lib/synthesize. + 1. Add nanoflann to the include dirs in cmake and sohpus to the include and link dirs + 2. Downgrade cmake to version 3.6.0 + 3. Install Eigen 3.3.90 + 4. If Pangolin is already installed, reinstall Pangolin, since it will be pointing at the old eigen which has the cuda bug mentioned here: https://devtalk.nvidia.com/default/topic/1026622/cuda-programming-and-performance/nvcc-can-t-compile-code-that-uses-eigen/ + 5. Upgrade boost to 1.67.0 and move lib to /usr/lib/x86_64-linux-gnu and include boost the whole folder to /usr/include + -4. Compile lib/synthesize with cmake (optional). This package contains a few useful tools such as generating synthetic images for training and ICP. +5. Compile lib/synthesize with cmake (optional). This package contains a few useful tools such as generating synthetic images for training and ICP. Install dependencies: - - [Pangolin](https://github.com/stevenlovegrove/Pangolin) - - [Eigen](https://eigen.tuxfamily.org) - - [boost](https://www.boost.org/) - - [Sophus](https://github.com/strasdat/Sophus) - - [nanoflann](https://github.com/jlblancoc/nanoflann) - - [nlopt](https://nlopt.readthedocs.io/en/latest/) - - libsuitesparse-dev(apt install) - - openexr(apt install) - - libopenexr-dev(apt install) + - Python version 2.7, 3.X won't work + - [Pangolin](https://github.com/stevenlovegrove/Pangolin) commit 1ec721d59ff6b799b9c24b8817f3b7ad2c929b83 worked for me, original author used c2a6ef524401945b493f14f8b5b8aa76cc7d71a9 + - [Eigen](https://eigen.tuxfamily.org) 3.3.90 + - [boost](https://www.boost.org/) 1.67.0 + - [Sophus](https://github.com/strasdat/Sophus) commit ceb6380a1584b300e687feeeea8799353d48859f + - [nanoflann](https://github.com/jlblancoc/nanoflann) commit ad7547f4e6beb1cdb3e360912fd2e352ef959465 + - [nlopt](https://github.com/stevengj/nlopt) Important install from this github repo, not using the instructions [here](https://nlopt.readthedocs.io/en/latest/) commit 74e647b667f7c4500cdb4f37653e59c29deb9ee2 We use Boost.Python library to link tensorflow with the c++ code. Make sure you have it in your Boost. The tested Boost version is 1.66.0. - Change hard coded pathes in CMakeLists.txt. - - The Pangolin branch I use: c2a6ef524401945b493f14f8b5b8aa76cc7d71a9 - + 1. Change hard coded pathes in CMakeLists.txt of boost and add sophus paths manually or via find_script. + 2. Uncomment ${CUDA_TOOLKIT_ROOT_DIR}/samples/common/inc from include dirs because of this issue: https://github.com/stevenlovegrove/Pangolin/issues/268 + 3. Surpress these warnings so you see errors better. + 4. Adapt boost_python and boost_numpy in Cmake line 98/99 to your library name when using boost and python 3.5 it is boost_python27 and boost_numpy27 or symlink these to boots_python and boost_numpy. + 5. Create folder data and models under data/LOV and add or symlink the data and models into there + +### Building + 1. Build kinect_fusion + + ```Shell + cd $ROOT/lib/kinect_fusion + mkdir build + cd build + cmake .. + make + ``` + 2. Build synthesize + ```Shell cd $ROOT/lib/synthesize mkdir build @@ -61,10 +79,19 @@ If you find PoseCNN useful in your research, please consider citing: cmake .. make ``` + 3. Compile the new layers under $ROOT/lib we introduce in PoseCNN. + ```Shell + cd $ROOT/lib + sh make.sh + ``` + + 4. run python setup ```python setup.py build_ext --inplace``` + + 5. Add pythonpaths Add the path of the built libary libsynthesizer.so to python path ```Shell - export PYTHONPATH=$PYTHONPATH:$ROOT/lib/synthesize/build + export PYTHONPATH=$PYTHONPATH:$ROOT/lib:$ROOT/lib/synthesize/build ``` ### Required environment From 4fd269461441abf9aadce7a1bd04f7e799ccb219 Mon Sep 17 00:00:00 2001 From: Kaju-Bubanja Date: Fri, 10 Aug 2018 10:45:51 +0200 Subject: [PATCH 3/3] More updates --- README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1d40724..0fb3c75 100644 --- a/README.md +++ b/README.md @@ -54,9 +54,16 @@ If you find PoseCNN useful in your research, please consider citing: We use Boost.Python library to link tensorflow with the c++ code. Make sure you have it in your Boost. The tested Boost version is 1.66.0. - 1. Change hard coded pathes in CMakeLists.txt of boost and add sophus paths manually or via find_script. + 1. Change hard coded pathes in lib/synthesize/CMakeLists.txt of boost and add sophus paths manually or via find_script. Uncomment line #add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0) to fix potential compatibility issues with tf. 2. Uncomment ${CUDA_TOOLKIT_ROOT_DIR}/samples/common/inc from include dirs because of this issue: https://github.com/stevenlovegrove/Pangolin/issues/268 3. Surpress these warnings so you see errors better. + ```add_definitions(-Wno-sign-compare) + add_definitions(-Wno-unused-result) + add_definitions(-Wno-unused-but-set-variable) + add_definitions(-Wno-unused-variable) + add_definitions(-Wno-reorder) + add_definitions(-Wno-deprecated-declarations) + ``` 4. Adapt boost_python and boost_numpy in Cmake line 98/99 to your library name when using boost and python 3.5 it is boost_python27 and boost_numpy27 or symlink these to boots_python and boost_numpy. 5. Create folder data and models under data/LOV and add or symlink the data and models into there