I try to build this part of the repo (looks like main one https://github.com/bobetocalo/faces_framework does not build it automatically). I downloaded docker image of tensorflow 1.8.0 as it is quite old:
docker run -it --rm --runtime=nvidia -v ~/MNN:/app tensorflow/tensorflow:1.8.0-gpu-py3 bash
Built and installed opencv4 there (opencv3 does not want to build as compiler version is too high).
# install opencv2 with all dependencies
apt install libopencv-dev
# get boost >1.64
add-apt-repository ppa:mhier/libboost-latest
apt-get update
apt install libboost1.68-dev
# 3.x does not build, too big version of gcc
wget -O opencv.zip https://github.com/Itseez/opencv/archive/4.1.1.zip
unzip opencv.zip
cd opencv-4.1.1
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D INSTALL_C_EXAMPLES=OFF ..
make -j4
make install clean
I made a replacement in project's CMakeLists.txt
to use this version, haven't tested it though. Build went Ok.
find_package(OpenCV 4 REQUIRED)
Now I want to build this particular repo. I added tensorflow includes to CMakeLists:
# get tf include dir:
python3 -c 'import tensorflow as tf; print(tf.sysconfig.get_include())'
Added to faces_framework/multitask/bobetocalo_pami20/CMakeLists.txt
:
include_directories(/usr/local/lib/python3.5/dist-packages/tensorflow/include)
When I try to build, I face that it wants include files like tensorflow/cc/ops/standard_ops.h
which are not included in standard tensorflow include. I downloaded tensorflow-1.8.0 source files as suggested here and used the directory from there:
cd faces_framework/multitask/bobetocalo_pami20
wget https://github.com/tensorflow/tensorflow/archive/refs/tags/v1.8.0.zip
unzip v1.8.0.zip
mv tensorflow-1.8.0/tensorflow .
and added the lines to faces_framework/multitask/bobetocalo_pami20/CMakeLists.txt
:
include_directories(/usr/local/lib/python3.5/dist-packages/tensorflow/include)
include_directories(/app/faces_framework/multitask/bobetocalo_pami20/tensorflow/cc/ops)
include_directories(/app/faces_framework/multitask/bobetocalo_pami20)
But I still fail with dependencies:
[ 80%] Building CXX object CMakeFiles/face_multitask_bobetocalo_pami20_test.dir/src/FaceMultitaskMnnOr.cpp.o
In file included from /app/faces_framework/multitask/bobetocalo_pami20/include/HonariChannelFeatures.hpp:22:0,
from /app/faces_framework/multitask/bobetocalo_pami20/include/ShapeCascade.hpp:19,
from /app/faces_framework/multitask/bobetocalo_pami20/include/FaceMultitaskMnnOr.hpp:17,
from /app/faces_framework/multitask/bobetocalo_pami20/src/FaceMultitaskMnnOr.cpp:11:
/app/faces_framework/multitask/bobetocalo_pami20/tensorflow/cc/ops/standard_ops.h:19:41: fatal error: tensorflow/cc/ops/array_ops.h: No such file or directory
compilation terminated.
CMakeFiles/face_multitask_bobetocalo_pami20_test.dir/build.make:374: recipe for target 'CMakeFiles/face_multitask_bobetocalo_pami20_test.dir/src/FaceMultitaskMnnOr.cpp.o' failed
As stated here https://github.com/tensorflow/tensorflow/issues/9253, array_ops.h
is generated file, so I cannot have it normally, only "when building bazel targets that depend on it."
How can I build your project?