facebookresearch / Detectron

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

error inBuilding CXX object /zero_even_op.cc.o #612

Closed ghost closed 6 years ago

ghost commented 6 years ago

I installed caffe2 with anaconda using the following command based on the caffe2 installation guide: ./scripts/build_anaconda.sh --install-locally --cuda 9.0 --cudnn 7 the installation completed without error. then I installed the Detectron and it passed the "test_spatial_narrow_as_op.py" test. but when I tried to install "Custom Operators for New Research Projects" following the instructions

Expected results

I received following error and compilation stopped!

Actual results

What did you observe instead? [ 20%] Building NVCC (Device) object CMakeFiles/caffe2_detectron_custom_ops_gpu.dir/detectron/ops/caffe2_detectron_custom_ops_gpu_generated_zero_even_op.cu.o Scanning dependencies of target caffe2_detectron_custom_ops make[3]: Leaving directory '/home/behnazrezaei/Code/PoseEstimation/DetectAndTrack/detectron/build' make[3]: Entering directory '/home/behnazrezaei/Code/PoseEstimation/DetectAndTrack/detectron/build' [ 40%] Building CXX object CMakeFiles/caffe2_detectron_custom_ops.dir/detectron/ops/zero_even_op.cc.o In file included from /home/behnazrezaei/anaconda2/include/caffe2/core/allocator.h:6:0, from /home/behnazrezaei/anaconda2/include/caffe2/core/context.h:9, from /home/behnazrezaei/Code/PoseEstimation/DetectAndTrack/detectron/detectron/ops/zero_even_op.h:20, from /home/behnazrezaei/Code/PoseEstimation/DetectAndTrack/detectron/detectron/ops/zero_even_op.cc:17: /home/behnazrezaei/anaconda2/include/caffe2/core/logging.h:10:29: fatal error: ATen/core/Error.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/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/behnazrezaei/Code/PoseEstimation/DetectAndTrack/detectron/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.... In file included from /home/behnazrezaei/anaconda2/include/caffe2/core/context_gpu.h:7:0, from /home/behnazrezaei/Code/PoseEstimation/DetectAndTrack/detectron/detectron/ops/zero_even_op.cu:17: /home/behnazrezaei/anaconda2/include/caffe2/core/common.h:29:30: fatal error: ATen/core/Macros.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/behnazrezaei/Code/PoseEstimation/DetectAndTrack/detectron/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]: Leaving directory '/home/behnazrezaei/Code/PoseEstimation/DetectAndTrack/detectron/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/behnazrezaei/Code/PoseEstimation/DetectAndTrack/detectron/build' Makefile:127: recipe for target 'all' failed make[1]: [all] Error 2 make[1]: Leaving directory '/home/behnazrezaei/Code/PoseEstimation/DetectAndTrack/detectron/build' Makefile:13: recipe for target 'ops' failed make: [ops] Error 2

Detailed steps to reproduce

cd $DETECTRON && make ops

The command that you ran

cd $DETECTRON mkdir -p build && cd build && cmake .. && make -j12

-- 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
-- Caffe2: Found gflags with new-style gflags target. -- Caffe2: Cannot find glog automatically. Using legacy find. -- Found glog: /home/behnazrezaei/anaconda2/include
-- Caffe2: Found glog (include: /home/behnazrezaei/anaconda2/include, library: /home/behnazrezaei/anaconda2/lib/libglog.so) -- Caffe2: Found protobuf with new-style protobuf targets. -- Caffe2: Protobuf version 3.5.0 -- Found CUDA: /usr/local/cuda (found suitable version "9.0", minimum required is "7.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/include
-- Found cuDNN: v7.1.4 (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libcudnn.so) -- Autodetected CUDA architecture(s): 6.1 6.1 6.1 6.1 -- Added CUDA NVCC flags for: -gencode;arch=compute_61,code=sm_61 -- 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 : 0.8.2 -- Caffe2 include path : /home/behnazrezaei/anaconda2/include -- Caffe2 found CUDA : True -- CUDA version : 9.0 -- CuDNN version : 7.1.4 -- Configuring done -- Generating done

System information

gadcam commented 6 years ago

@brezae

fatal error: ATen/core/Error.h: No such file or directory fatal error: ATen/core/Macros.h: No such file or directory

Looks very similar to #595 Maybe the solution is here https://github.com/facebookresearch/Detectron/issues/595#issuecomment-409955475

Computational-Camera commented 6 years ago

I came across same problem. If you are using Anaconda2, you can fix it by move all the files from Anaconda2/include/ATen/core/core to Anaconda2/include/ATen/core/

ghost commented 6 years ago

@Computational-Camera Thank you it worked, the header files were copied in the wrong directory as you mentioned