MPI-IS / bilateralNN

Learning Sparse High Dimensional Filters with Neural Networks
http://bilateralnn.is.tue.mpg.de
BSD 3-Clause "New" or "Revised" License
69 stars 25 forks source link

How to set makefile config? #6

Closed Sarah20187 closed 7 years ago

Sarah20187 commented 7 years ago

I can install successfully. But when I make bilateralNN, the cudnn parts always have errors. I wonder weather I need to set the makefile config? Errors:

/raid5/sarah/bilateralNN/build/tmp_caffe_clone/src/CaffeUpstream/src/caffe/layers/cudnn_tanh_layer.cu(13): error: argument of type "cudnnActivationMode_t" is incompatible with parameter of type "cudnnActivationDescriptor_t" detected during instantiation of "void caffe::CuDNNTanHLayer::Forward_gpu(const std::vector<caffe::Blob , std::allocator<caffe::Blob >> &, const std::vector<caffe::Blob , std::allocator<caffe::Blob >> &) [with Dtype=float]" (43): here

/raid5/sarah/bilateralNN/build/tmp_caffe_clone/src/CaffeUpstream/src/caffe/layers/cudnn_tanh_layer.cu(34): error: argument of type "cudnnActivationMode_t" is incompatible with parameter of type "cudnnActivationDescriptor_t" detected during instantiation of "void caffe::CuDNNTanHLayer::Backward_gpu(const std::vector<caffe::Blob , std::allocator<caffe::Blob >> &, const std::vector<__nv_bool, std::allocator<__nv_bool>> &, const std::vector<caffe::Blob , std::allocator<caffe::Blob >> &) [with Dtype=float]" (43): here

/raid5/sarah/bilateralNN/build/tmp_caffe_clone/src/CaffeUpstream/src/caffe/layers/cudnn_tanh_layer.cu(13): error: argument of type "cudnnActivationMode_t" is incompatible with parameter of type "cudnnActivationDescriptor_t" detected during instantiation of "void caffe::CuDNNTanHLayer::Forward_gpu(const std::vector<caffe::Blob , std::allocator<caffe::Blob >> &, const std::vector<caffe::Blob , std::allocator<caffe::Blob >> &) [with Dtype=double]" (43): here

I searched on google that this problem is caused by cudnn version. However, I tried cudnn v4,5,6 by cmake -DCUDNN_INCLUDE=/home/sarah/dependencies/cudnn_v6_7.5/cuda/include/ -DCUDNN_LIBRARY=/home/sarah/dependencies/cudnn_v6_7.5/cuda/lib64 .. but this problem still remains.

figuration FYI

loading initial cache file /raid5/sarah/bilateralNN/build/tmp_caffe_clone/tmp/CaffeUpstream-cache-.cmake -- Boost version: 1.54.0 -- Found the following Boost libraries: -- system -- thread -- filesystem -- Found gflags (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libgflags.so) -- Found glog (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libglog.so) -- Found PROTOBUF Compiler: /usr/bin/protoc -- Found lmdb (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/liblmdb.so) -- Found LevelDB (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libleveldb.so) -- Found Snappy (include: /usr/include, library: /usr/lib/libsnappy.so) -- CUDA detected: 7.5 -- Found cuDNN: ver. 6.0.21 found (include: /home/sarah/dependencies/cudnn_v6_7.5/cuda/include, library: /home/sarah/dependencies/cudnn_v6_7.5/cuda/lib64) -- Added CUDA NVCC flags for: sm_52 -- OpenCV found (/home/sarah/anaconda2/share/OpenCV) -- Found Atlas (include: /usr/include, library: /usr/lib/libatlas.so) -- NumPy ver. 1.11.3 found (include: /home/sarah/anaconda2/lib/python2.7/site-packages/numpy/core/include) -- Boost version: 1.54.0 -- Found the following Boost libraries: -- python -- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE) -- -- Caffe Configuration Summary -- General: -- Version : 1.0.0-rc3 -- Git : rc3-62-ga1c81ac-dirty -- System : Linux -- C++ compiler : /usr/bin/c++ -- Release CXX flags : -O3 -DNDEBUG -fPIC -Wall -Wno-sign-compare -Wno-uninitialized -- Debug CXX flags : -g -fPIC -Wall -Wno-sign-compare -Wno-uninitialized -- Build type : Release -- -- BUILD_SHARED_LIBS : ON -- BUILD_python : ON -- BUILD_matlab : OFF -- BUILD_docs : ON -- CPU_ONLY : OFF -- USE_OPENCV : ON -- USE_LEVELDB : ON -- USE_LMDB : ON -- ALLOW_LMDB_NOLOCK : OFF -- -- Dependencies: -- BLAS : Yes (Atlas) -- Boost : Yes (ver. 1.54) -- glog : Yes -- gflags : Yes -- protobuf : Yes (ver. 2.5.0) -- lmdb : Yes (ver. 0.9.10) -- LevelDB : Yes (ver. 1.15) -- Snappy : Yes (ver. 1.1.0) -- OpenCV : Yes (ver. 3.2.0) -- CUDA : Yes (ver. 7.5) -- -- NVIDIA CUDA: -- Target GPU(s) : Auto -- GPU arch(s) : sm_52 -- cuDNN : Yes (ver. 6.0.21) -- -- Python: -- Interpreter : /home/sarah/anaconda2/bin/python2.7 (ver. 2.7.13) -- Libraries : /usr/lib/x86_64-linux-gnu/libpython2.7.so (ver 2.7.13) -- NumPy : /home/sarah/anaconda2/lib/python2.7/site-packages/numpy/core/include (ver 1.11.3) -- -- Documentaion: -- Doxygen : No -- config_file :
-- -- Install: -- Install path : /raid5/sarah/bilateralNN/build/bin/install -- -- Configuring done -- Generating done -- Build files have been written to: /raid5/sarah/bilateralNN/build/bin

raffienficiaud commented 7 years ago

This seems to be a Caffee problem. Which version of Caffee are you using? Is this the one that has been advertised on the main readme? (a1c81aca641e5b16f3e2007be07dfdedc072606e)

Sarah20187 commented 7 years ago

Yes,i use the first method,which download the caffe version you suggested itself. On Sat, 20 May 2017 at 14:33 Raffi Enficiaud notifications@github.com wrote:

This seems to be a Caffee problem. Which version of Caffee are you using? Is this the one that has been advertised on the main readme? ( a1c81aca641e5b16f3e2007be07dfdedc072606e)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/MPI-IS/bilateralNN/issues/6#issuecomment-302870450, or mute the thread https://github.com/notifications/unsubscribe-auth/APZ21zZNxAXWZFXo_VelP8ZR0_BAXBTUks5r7t2ygaJpZM4NgoEs .

varunjampani commented 7 years ago

Thanks for reporting the error. From the error, it seems there is some incompatibility with 'cudnn_tanh_layer'. Are you able to install Caffe without any bilateral (permutohedral) layers? Can you please try the manual way of adding the bilateralNN layers to your Caffe and try recompiling? Thanks.

Sarah20187 commented 7 years ago

@raffienficiaud @varunjampani I tried the Manual way of Patching an existing Caffe version(reset the version to a1c81aca641e5b16f3e2007be07dfdedc072606e). It works. Thank you!

varunjampani commented 7 years ago

Thats great. Thanks for reporting. I am closing this issue then.

hailingluo commented 6 years ago

I have the similar issue when I make bilateralNN, the cudnn and CUDA parts always have errors. And I try the manual way of Patching and , but it still doesn't work . How to find the caffe version (a1c81aca641e5b16f3e2007be07dfdedc072606e) ? The caffe version which I am using is the one proposed by BLVC.

Errors: (part of) /home/lhl/bilateralNN/build/tmp_caffe_clone/src/CaffeUpstream/src/caffe/layers/cudnn_relu_layer.cu(18): error: argument of type "cudnnActivationMode_t" is incompatible with parameter of type "cudnnActivationDescriptor_t" detected during instantiation of "void caffe::CuDNNReLULayer::Forward_gpu(const std::vector<caffe::Blob , std::allocator<caffe::Blob >> &, const std::vector<caffe::Blob , std::allocator<caffe::Blob >> &) [with Dtype=float]" (52): here

/home/lhl/bilateralNN/build/tmp_caffe_clone/src/CaffeUpstream/src/caffe/layers/cudnn_relu_layer.cu(43): error: argument of type "cudnnActivationMode_t" is incompatible with parameter of type "cudnnActivationDescriptor_t" detected during instantiation of "void caffe::CuDNNReLULayer::Backward_gpu(const std::vector<caffe::Blob , std::allocator<caffe::Blob >> &, const std::vector<__nv_bool, std::allocator<__nv_bool>> &, const std::vector<caffe::Blob , std::allocator<caffe::Blob >> &) [with Dtype=float]" (52): here

/home/lhl/bilateralNN/build/tmp_caffe_clone/src/CaffeUpstream/src/caffe/layers/cudnn_relu_layer.cu(18): error: argument of type "cudnnActivationMode_t" is incompatible with parameter of type "cudnnActivationDescriptor_t" detected during instantiation of "void caffe::CuDNNReLULayer::Forward_gpu(const std::vector<caffe::Blob , std::allocator<caffe::Blob >> &, const std::vector<caffe::Blob , std::allocator<caffe::Blob >> &) [with Dtype=double]" (52): here

/home/lhl/bilateralNN/build/tmp_caffe_clone/src/CaffeUpstream/src/caffe/layers/cudnn_relu_layer.cu(43): error: argument of type "cudnnActivationMode_t" is incompatible with parameter of type "cudnnActivationDescriptor_t" detected during instantiation of "void caffe::CuDNNReLULayer::Backward_gpu(const std::vector<caffe::Blob , std::allocator<caffe::Blob >> &, const std::vector<__nv_bool, std::allocator<__nv_bool>> &, const std::vector<caffe::Blob , std::allocator<caffe::Blob >> &) [with Dtype=double]" (52): here

4 errors detected in the compilation of "/tmp/tmpxft_00005f34_00000000-7_cudnn_relu_layer.cpp1.ii". CMake Error at cuda_compile_generated_cudnn_relu_layer.cu.o.cmake:266 (message): Error generating file /home/lhl/bilateralNN/build/bin/src/caffe/CMakeFiles/cuda_compile.dir/layers/./cuda_compile_generated_cudnn_relu_layer.cu.o

src/caffe/CMakeFiles/caffe.dir/build.make:18511: recipe for target 'src/caffe/CMakeFiles/cuda_compile.dir/layers/cuda_compile_generated_cudnn_relu_layer.cu.o' failed make[5]: [src/caffe/CMakeFiles/cuda_compile.dir/layers/cuda_compile_generated_cudnn_relu_layer.cu.o] Error 1 make[5]: Waiting for unfinished jobs.... /home/lhl/bilateralNN/build/tmp_caffe_clone/src/CaffeUpstream/src/caffe/layers/cudnn_sigmoid_layer.cu(13): error: argument of type "cudnnActivationMode_t" is incompatible with parameter of type "cudnnActivationDescriptor_t" detected during instantiation of "void caffe::CuDNNSigmoidLayer::Forward_gpu(const std::vector<caffe::Blob , std::allocator<caffe::Blob >> &, const std::vector<caffe::Blob , std::allocator<caffe::Blob >> &) [with Dtype=float]" (42): here

/home/lhl/bilateralNN/build/tmp_caffe_clone/src/CaffeUpstream/src/caffe/layers/cudnn_sigmoid_layer.cu(33): error: argument of type "cudnnActivationMode_t" is incompatible with parameter of type "cudnnActivationDescriptor_t" detected during instantiation of "void caffe::CuDNNSigmoidLayer::Backward_gpu(const std::vector<caffe::Blob , std::allocator<caffe::Blob >> &, const std::vector<__nv_bool, std::allocator<__nv_bool>> &, const std::vector<caffe::Blob , std::allocator<caffe::Blob >> &) [with Dtype=float]" (42): here

/home/lhl/bilateralNN/build/tmp_caffe_clone/src/CaffeUpstream/src/caffe/layers/cudnn_sigmoid_layer.cu(13): error: argument of type "cudnnActivationMode_t" is incompatible with parameter of type "cudnnActivationDescriptor_t" detected during instantiation of "void caffe::CuDNNSigmoidLayer::Forward_gpu(const std::vector<caffe::Blob , std::allocator<caffe::Blob >> &, const std::vector<caffe::Blob , std::allocator<caffe::Blob >> &) [with Dtype=double]" (42): here

/home/lhl/bilateralNN/build/tmp_caffe_clone/src/CaffeUpstream/src/caffe/layers/cudnn_sigmoid_layer.cu(33): error: argument of type "cudnnActivationMode_t" is incompatible with parameter of type "cudnnActivationDescriptor_t" detected during instantiation of "void caffe::CuDNNSigmoidLayer::Backward_gpu(const std::vector<caffe::Blob , std::allocator<caffe::Blob >> &, const std::vector<__nv_bool, std::allocator<__nv_bool>> &, const std::vector<caffe::Blob , std::allocator<caffe::Blob >> &) [with Dtype=double]" (42): here

4 errors detected in the compilation of "/tmp/tmpxft_00005ecb_00000000-7_cudnn_sigmoid_layer.cpp1.ii". CMake Error at cuda_compile_generated_cudnn_sigmoid_layer.cu.o.cmake:266 (message): Error generating file /home/lhl/bilateralNN/build/bin/src/caffe/CMakeFiles/cuda_compile.dir/layers/./cuda_compile_generated_cudnn_sigmoid_layer.cu.o

src/caffe/CMakeFiles/caffe.dir/build.make:5908: recipe for target 'src/caffe/CMakeFiles/cuda_compile.dir/layers/cuda_compile_generated_cudnn_sigmoid_layer.cu.o' failed make[5]: *** [src/caffe/CMakeFiles/cuda_compile.dir/layers/cuda_compile_generated_cudnn_sigmoid_layer.cu.o] Error 1 /home/lhl/bilateralNN/build/tmp_caffe_clone/src/CaffeUpstream/include/caffe/util/cudnn.hpp(107): error: too few arguments in function call

/home/lhl/bilateralNN/build/tmp_caffe_clone/src/CaffeUpstream/include/caffe/util/cudnn.hpp(126): error: argument of type "int" is incompatible with parameter of type "cudnnNanPropagation_t"

/home/lhl/bilateralNN/build/tmp_caffe_clone/src/CaffeUpstream/include/caffe/util/cudnn.hpp(126): error: too few arguments in function call

/home/lhl/bilateralNN/build/tmp_caffe_clone/src/CaffeUpstream/src/caffe/layers/cudnn_conv_layer.cu(85): error: identifier "cudnnConvolutionBackwardFilter_v3" is undefined detected during instantiation of "void caffe::CuDNNConvolutionLayer::Backward_gpu(const std::vector<caffe::Blob , std::allocator<caffe::Blob >> &, const std::vector<__nv_bool, std::allocator<__nv_bool>> &, const std::vector<caffe::Blob , std::allocator<caffe::Blob >> &) [with Dtype=float]" (123): here

/home/lhl/bilateralNN/build/tmp_caffe_clone/src/CaffeUpstream/src/caffe/layers/cudnn_conv_layer.cu(103): error: identifier "cudnnConvolutionBackwardData_v3" is undefined 3 errors detected during instantiation of "void caffe::CuDNNConvolutionLayer::Backward_gpu(const std::vector<caffe::Blob , std::allocator<caffe::Blob >> &, const std::vector<__nv_bool, std::allocator<__nv_bool>> &, const std::vector<caffe::Blob , std::allocator<caffe::Blob >> &) [with Dtype=float]" (123): here

/home/lhl/bilateralNN/build/tmp_caffe_clone/src/CaffeUpstream/src/caffe/layers/cudnn_conv_layer.cu(85): error: identifier "cudnnConvolutionBackwardFilter_v3" is undefined detected in the compilation of "/tmp/tmpxft_00005dfa_00000000-5_base_data_layer.cpp4.ii". detected during instantiation of "void caffe::CuDNNConvolutionLayer::Backward_gpu(const std::vector<caffe::Blob , std::allocator<caffe::Blob >> &, const std::vector<__nv_bool, std::allocator<__nv_bool>> &, const std::vector<caffe::Blob , std::allocator<caffe::Blob >> &) [with Dtype=double]" (123): here

/home/lhl/bilateralNN/build/tmp_caffe_clone/src/CaffeUpstream/src/caffe/layers/cudnn_conv_layer.cu(103): error: identifier "cudnnConvolutionBackwardData_v3" is undefined detected during instantiation of "void caffe::CuDNNConvolutionLayer::Backward_gpu(const std::vector<caffe::Blob , std::allocator<caffe::Blob >> &, const std::vector<__nv_bool, std::allocator<__nv_bool>> &, const std::vector<caffe::Blob , std::allocator<caffe::Blob >> &) [with Dtype=double]" (123): here

4 errors detected in the compilation of "/tmp/tmpxft_00005f52_00000000-7_cudnn_conv_layer.cpp1.ii". /home/lhl/bilateralNN/build/tmp_caffe_clone/src/CaffeUpstream/include/caffe/util/cudnn.hpp(107): error: too few arguments in function call ...

src/caffe/CMakeFiles/caffe.dir/build.make:16734: recipe for target 'src/caffe/CMakeFiles/cuda_compile.dir/layers/cuda_compile_generated_pixel_feature_layer.cu.o' failed make[5]: [src/caffe/CMakeFiles/cuda_compile.dir/layers/cuda_compile_generated_pixel_feature_layer.cu.o] Error 1 CMakeFiles/Makefile2:272: recipe for target 'src/caffe/CMakeFiles/caffe.dir/all' failed make[4]: [src/caffe/CMakeFiles/caffe.dir/all] Error 2 Makefile:127: recipe for target 'all' failed make[3]: [all] Error 2 CMakeFiles/CaffeUpstream.dir/build.make:112: recipe for target 'tmp_caffe_clone/src/CaffeUpstream-stamp/CaffeUpstream-build' failed make[2]: [tmp_caffe_clone/src/CaffeUpstream-stamp/CaffeUpstream-build] Error 2 CMakeFiles/Makefile2:99: recipe for target 'CMakeFiles/CaffeUpstream.dir/all' failed make[1]: [CMakeFiles/CaffeUpstream.dir/all] Error 2 Makefile:83: recipe for target 'all' failed make: [all] Error 2

varunjampani commented 6 years ago

Seems like you have issues with CUDNN compatibility. Can you compile your default caffe without any of the bilateralNN layers? You can reset to the specific version with this command: git reset --hard a1c81aca641e5b16f3e2007be07dfdedc072606e or git checkout a1c81aca641e5b16f3e2007be07dfdedc072606e

hailingluo commented 6 years ago

@varunjampani Thanks for your help. But another new issue with CUDNN has arisen when I compile the caffe version (a1c81aca641e5b16f3e2007be07dfdedc072606e). I can compile my default caffe without any of the bilateralNN layers, but failed in the specific version. So I replace the old cudnn_* with the newest corresponding files to fix the problems. However when I compile the specific version caffe with bilateralNN, there are some errors with permutohedral_pooling_layer.

errors: src/caffe/layers/permutohedral_pooling_layer.cpp: In member function ‘virtual void caffe::PermutohedralPoolingLayer::LayerSetUp(const std::vector<caffe::Blob>&, const std::vector<caffe::Blob>&)’: src/caffe/layers/permutohedral_pooling_layer.cpp:22:3: error: ‘PermutohedralPoolingParameter’ was not declared in this scope PermutohedralPoolingParameter permutohedral_pooling_param = ^ src/caffe/layers/permutohedral_pooling_layer.cpp:25:23: error: ‘permutohedral_pooling_param’ was not declared in this scope do_repeatedinit = permutohedral_pooling_param.repeated_init(); ^ src/caffe/layers/permutohedral_pooling_layer.cpp: In member function ‘void caffe::PermutohedralPoolingLayer::InitLattice(const caffe::Blob, const caffe::Blob&, const caffe::Blob&, caffe::Blob)’: src/caffe/layers/permutohedral_pooling_layer.cpp:136:16: error: ‘PermutohedralPoolingParameter_NormType_AFTER’ was not declared in this scope case PermutohedralPoolingParameter_NormType_AFTER: ^ src/caffe/layers/permutohedral_pooling_layer.cpp:145:16: error: ‘PermutohedralPoolingParameter_NormType_SYMMETRIC’ was not declared in this scope case PermutohedralPoolingParameter_NormType_SYMMETRIC: ^ src/caffe/layers/permutohedral_pooling_layer.cpp: In instantiation of ‘void caffe::PermutohedralPoolingLayer::InitLattice(const caffe::Blob, const caffe::Blob&, const caffe::Blob&, caffe::Blob) [with Dtype = float]’: src/caffe/layers/permutohedral_pooling_layer.cpp:336:1: required from here src/caffe/layers/permutohedral_pooling_layer.cpp:135:11: error: ‘class caffe::LayerParameter’ has no member named ‘permutohedral_pooling_param’ switch (this->layerparam.permutohedral_pooling_param().norm_type()) { ^ src/caffe/layers/permutohedral_pooling_layer.cpp: In instantiation of ‘void caffe::PermutohedralPoolingLayer::InitLattice(const caffe::Blob, const caffe::Blob&, const caffe::Blob&, caffe::Blob) [with Dtype = double]’: src/caffe/layers/permutohedral_pooling_layer.cpp:336:1: required from here src/caffe/layers/permutohedral_pooling_layer.cpp:135:11: error: ‘class caffe::LayerParameter’ has no member named ‘permutohedral_pooling_param’ Makefile:572: recipe for target '.build_release/src/caffe/layers/permutohedral_pooling_layer.o' failed make: *** [.build_release/src/caffe/layers/permutohedral_pooling_layer.o] Error 1