facebookresearch / DensePose

A real-time approach for mapping all human pixels of 2D RGB images to a 3D surface-based model of the body
http://densepose.org
Other
6.95k stars 1.29k forks source link

Compilation issue #144

Open andreaskoelsch opened 5 years ago

andreaskoelsch commented 5 years ago

I tried to install densepose as described in the installation instructions, but it seems to have some problem with caffe2. Maybe, this is, because caffe2 is now part of PyTorch? It says, it can't find context.h, but it should find it in the Caffe2 include path...

Anyone has an idea? I compiled pytorch myself according to the instructions given at https://caffe2.ai/docs/getting-started.html?platform=ubuntu&configuration=compile

~/Desktop/densepose$ make ops
mkdir -p build && cd build && cmake .. && make -j8
-- Caffe2: CUDA detected: 10.0
-- Caffe2: CUDA nvcc is: /usr/local/cuda/bin/nvcc
-- Caffe2: CUDA toolkit directory: /usr/local/cuda
-- Caffe2: Header version is: 10.0
-- Found cuDNN: v7.3.1  (include: /usr/local/cuda/include, library: /usr/local/cuda/lib64/libcudnn.so)
-- Autodetected CUDA architecture(s): 6.1
-- Added CUDA NVCC flags for: -gencode;arch=compute_61,code=sm_61
-- Summary:
--   CMake version        : 3.10.2
--   CMake command        : /usr/bin/cmake
--   System name          : Linux
--   C++ compiler         : /usr/bin/c++
--   C++ compiler version : 7.3.0
--   CXX flags            :  -std=c++11 -O2 -fPIC -Wno-narrowing
--   Caffe2 version       : 1.0.0
--   Caffe2 include path  : /home/koelscha/Desktop/pytorch/torch/lib/include
--   Caffe2 found CUDA    : True
--     CUDA version       : 10.0
--     CuDNN version      : 7.3.1
-- Configuring done
-- Generating done
-- Build files have been written to: /home/koelscha/Desktop/densepose/build
make[1]: Entering directory '/home/koelscha/Desktop/densepose/build'
make[2]: Entering directory '/home/koelscha/Desktop/densepose/build'
make[3]: Entering directory '/home/koelscha/Desktop/densepose/build'
make[3]: Entering directory '/home/koelscha/Desktop/densepose/build'
[ 12%] Building NVCC (Device) object CMakeFiles/caffe2_detectron_custom_ops_gpu.dir/detectron/ops/caffe2_detectron_custom_ops_gpu_generated_zero_even_op.cu.o
[ 25%] Building NVCC (Device) object CMakeFiles/caffe2_detectron_custom_ops_gpu.dir/detectron/ops/caffe2_detectron_custom_ops_gpu_generated_pool_points_interp.cu.o
make[3]: Leaving directory '/home/koelscha/Desktop/densepose/build'
make[3]: Entering directory '/home/koelscha/Desktop/densepose/build'
[ 37%] Building CXX object CMakeFiles/caffe2_detectron_custom_ops.dir/detectron/ops/zero_even_op.cc.o
[ 50%] Building CXX object CMakeFiles/caffe2_detectron_custom_ops.dir/detectron/ops/pool_points_interp.cc.o
In file included from /home/koelscha/Desktop/densepose/detectron/ops/zero_even_op.cc:9:0:
/home/koelscha/Desktop/densepose/detectron/ops/zero_even_op.h:12:10: fatal error: caffe2/core/context.h: No such file or directory
 #include "caffe2/core/context.h"
          ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
CMakeFiles/caffe2_detectron_custom_ops.dir/build.make:86: recipe for target 'CMakeFiles/caffe2_detectron_custom_ops.dir/detectron/ops/zero_even_op.cc.o' failed
make[3]: *** [CMakeFiles/caffe2_detectron_custom_ops.dir/detectron/ops/zero_even_op.cc.o] Error 1
make[3]: *** Waiting for unfinished jobs....
In file included from /home/koelscha/Desktop/densepose/detectron/ops/pool_points_interp.cc:10:0:
/home/koelscha/Desktop/densepose/detectron/ops/pool_points_interp.h:13:10: fatal error: caffe2/core/context.h: No such file or directory
 #include "caffe2/core/context.h"
          ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
CMakeFiles/caffe2_detectron_custom_ops.dir/build.make:62: recipe for target 'CMakeFiles/caffe2_detectron_custom_ops.dir/detectron/ops/pool_points_interp.cc.o' failed
make[3]: *** [CMakeFiles/caffe2_detectron_custom_ops.dir/detectron/ops/pool_points_interp.cc.o] Error 1
make[3]: Leaving directory '/home/koelscha/Desktop/densepose/build'
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/caffe2_detectron_custom_ops.dir/all' failed
make[2]: *** [CMakeFiles/caffe2_detectron_custom_ops.dir/all] Error 2
make[2]: *** Waiting for unfinished jobs....
/home/koelscha/Desktop/densepose/detectron/ops/zero_even_op.cu:9:10: fatal error: caffe2/core/context_gpu.h: No such file or directory
 #include "caffe2/core/context_gpu.h"
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
/home/koelscha/Desktop/densepose/detectron/ops/pool_points_interp.cu:11:10: fatal error: caffe2/core/context_gpu.h: No such file or directory
 #include "caffe2/core/context_gpu.h"
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
CMake Error at caffe2_detectron_custom_ops_gpu_generated_zero_even_op.cu.o.cmake:219 (message):
  Error generating
  /home/koelscha/Desktop/densepose/build/CMakeFiles/caffe2_detectron_custom_ops_gpu.dir/detectron/ops/./caffe2_detectron_custom_ops_gpu_generated_zero_even_op.cu.o

CMake Error at caffe2_detectron_custom_ops_gpu_generated_pool_points_interp.cu.o.cmake:219 (message):
  Error generating
  /home/koelscha/Desktop/densepose/build/CMakeFiles/caffe2_detectron_custom_ops_gpu.dir/detectron/ops/./caffe2_detectron_custom_ops_gpu_generated_pool_points_interp.cu.o

CMakeFiles/caffe2_detectron_custom_ops_gpu.dir/build.make:70: recipe for target 'CMakeFiles/caffe2_detectron_custom_ops_gpu.dir/detectron/ops/caffe2_detectron_custom_ops_gpu_generated_zero_even_op.cu.o' failed
make[3]: *** [CMakeFiles/caffe2_detectron_custom_ops_gpu.dir/detectron/ops/caffe2_detectron_custom_ops_gpu_generated_zero_even_op.cu.o] Error 1
make[3]: *** Waiting for unfinished jobs....
CMakeFiles/caffe2_detectron_custom_ops_gpu.dir/build.make:63: recipe for target 'CMakeFiles/caffe2_detectron_custom_ops_gpu.dir/detectron/ops/caffe2_detectron_custom_ops_gpu_generated_pool_points_interp.cu.o' failed
make[3]: *** [CMakeFiles/caffe2_detectron_custom_ops_gpu.dir/detectron/ops/caffe2_detectron_custom_ops_gpu_generated_pool_points_interp.cu.o] Error 1
make[3]: Leaving directory '/home/koelscha/Desktop/densepose/build'
CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/caffe2_detectron_custom_ops_gpu.dir/all' failed
make[2]: *** [CMakeFiles/caffe2_detectron_custom_ops_gpu.dir/all] Error 2
make[2]: Leaving directory '/home/koelscha/Desktop/densepose/build'
Makefile:129: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/home/koelscha/Desktop/densepose/build'
Makefile:13: recipe for target 'ops' failed
make: *** [ops] Error 2
ARMUGHAN-SHAHID commented 5 years ago

I have the same issue. Has anyone else been able to solve this

cameron2018 commented 5 years ago

me too

linkinpark213 commented 5 years ago

@cameron2018 @ARMUGHAN-SHAHID I solved this by adding the include path in the pytorch directory to CMakeLists.txt like this:

include_directories("/path/to/pytorch/torch/lib/include")

in which /path/to/pytorch/torch/lib/include should be the path where you find the context.h file.

ldoyvhe commented 4 years ago

@cameron2018 @ARMUGHAN-SHAHID I solved this by adding the include path in the pytorch directory to CMakeLists.txt like this:

include_directories("/path/to/pytorch/torch/lib/include")

in which /path/to/pytorch/torch/lib/include should be the path where you find the context.h file.

i do this but it doesnt work。