facebookresearch / Detectron

FAIR's research platform for object detection research, implementing popular algorithms like Mask R-CNN and RetinaNet.
Apache License 2.0
26.22k stars 5.45k forks source link

make ops failure #925

Open akirazhao opened 5 years ago

akirazhao commented 5 years ago

Expected results

make opssuccessfully.

Actual results

make ops fails to build with the following error

mkdir -p build && cd build && cmake .. && make -j8
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found CUDA: /usr/local/cuda (found version "9.0") 
-- Caffe2: CUDA detected: 9.0
-- Caffe2: CUDA nvcc is: /usr/local/cuda/bin/nvcc
-- Caffe2: CUDA toolkit directory: /usr/local/cuda
-- Caffe2: Header version is: 9.0
-- Found CUDNN: /usr/local/cuda/include  
-- Found cuDNN: v7.1.3  (include: /usr/local/cuda/include, library: /usr/local/cuda/lib64/libcudnn.so)
-- Autodetected CUDA architecture(s):  5.2
-- Added CUDA NVCC flags for: -gencode;arch=compute_52,code=sm_52
-- Summary:
--   CMake version        : 3.5.1
--   CMake command        : /usr/bin/cmake
--   System name          : Linux
--   C++ compiler         : /usr/bin/c++
--   C++ compiler version : 5.4.0
--   CXX flags            :  -std=c++11 -O2 -fPIC -Wno-narrowing
--   Caffe2 version       : 1.2.0
--   Caffe2 include path  : /home/akirazhao/pytorch/torch/include
--   Caffe2 found CUDA    : True
--     CUDA version       : 9.0
--     CuDNN version      : 7.1.3
-- Configuring done
-- Generating done
-- Build files have been written to: /home/akirazhao/densepose/build
make[1]: Entering directory '/home/akirazhao/densepose/build'
make[2]: Entering directory '/home/akirazhao/densepose/build'
make[3]: Entering directory '/home/akirazhao/densepose/build'
make[3]: Entering directory '/home/akirazhao/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
Scanning dependencies of target caffe2_detectron_custom_ops
make[3]: Leaving directory '/home/akirazhao/densepose/build'
make[3]: Entering directory '/home/akirazhao/densepose/build'
[ 37%] Building CXX object CMakeFiles/caffe2_detectron_custom_ops.dir/detectron/ops/pool_points_interp.cc.o
[ 50%] Building CXX object CMakeFiles/caffe2_detectron_custom_ops.dir/detectron/ops/zero_even_op.cc.o
In file included from /home/akirazhao/densepose/detectron/ops/pool_points_interp.cc:10:0:
/home/akirazhao/densepose/detectron/ops/pool_points_interp.h:13:26: fatal error: core/context.h: No such file or directory
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]: *** Waiting for unfinished jobs....
In file included from /home/akirazhao/densepose/detectron/ops/zero_even_op.cc:9:0:
/home/akirazhao/densepose/detectron/ops/zero_even_op.h:12:26: fatal error: core/context.h: No such file or directory
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]: Leaving directory '/home/akirazhao/densepose/build'
CMakeFiles/Makefile2:104: 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....
In file included from /home/akirazhao/densepose/detectron/ops/zero_even_op.cu:11:0:
/home/akirazhao/densepose/detectron/ops/zero_even_op.h:12:26: fatal error: core/context.h: No such file or directory
compilation terminated.
In file included from /home/akirazhao/densepose/detectron/ops/pool_points_interp.cu:12:0:
/home/akirazhao/densepose/detectron/ops/pool_points_interp.h:13:26: fatal error: core/context.h: No such file or directory
compilation terminated.
CMake Error at caffe2_detectron_custom_ops_gpu_generated_zero_even_op.cu.o.cmake:219 (message):
  Error generating
  /home/akirazhao/densepose/build/CMakeFiles/caffe2_detectron_custom_ops_gpu.dir/detectron/ops/./caffe2_detectron_custom_ops_gpu_generated_zero_even_op.cu.o

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_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....
CMake Error at caffe2_detectron_custom_ops_gpu_generated_pool_points_interp.cu.o.cmake:219 (message):
  Error generating
  /home/akirazhao/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_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/akirazhao/densepose/build'
CMakeFiles/Makefile2:67: 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/akirazhao/densepose/build'
Makefile:127: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/home/akirazhao/densepose/build'
Makefile:13: recipe for target 'ops' failed
make: *** [ops] Error 2

System information

Operating system: Ubuntu16.04
Compiler version: GNU 5.4.0
CUDA version: 9.0
cuDNN version: 7.1.3
NVIDIA driver version: 384
GPU models (for all devices if they are not all the same): Geforce GTX965M
PYTHONPATH environment variable: 

PYTHONPATH=/usr/local:/usr/local:/usr/local:/usr/local:/usr/local:/usr/local:/usr/local:/home/akirazhao/pytorch/build:/home/akirazhao/pytorch/build:/home/akirazhao/pytorch/torch/include/caffe2/:/home/akirazhao/pytorch/build:/home/akirazhao/pytorch/build:/home/akirazhao/pytorch/build:/home/akirazhao/pytorch/build:/home/akirazhao/pytorch/build:/home/akirazhao/pytorch/build

python --version output: 2.7.12
akirazhao commented 5 years ago

my issue looks similar to https://github.com/facebookresearch/Detectron/issues/595 & https://github.com/facebookresearch/Detectron/issues/612, it's the same problem with my environment variable, I tried a lot of methods including moving files to the target folder or add environment variable into CMakelists, but the issue still there.

nQuant commented 4 years ago

-- Caffe2 include path : /home/akirazhao/pytorch/torch/include

This include path may be wrong. Check if this directory contains core/context.h If it is not there, the right folder should be in the pytorch build directory if you built pytorch from source or in Python site-packages if you have used pip or conda install

nQuant commented 4 years ago

-- Caffe2 include path : /home/akirazhao/pytorch/torch/include

This include path may be wrong. Check if this directory contains core/context.h If it is not there, the right folder should be in the pytorch build directory if you built pytorch from source or in Python site-packages if you have used pip or conda install

Sorry, I checked that if pytorch/torch have no include directory then you just have to build pytorch succesfully to make it appear:

cd pytorch
python setup.py install