Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Caffe compile error #58

Closed
foqin opened this issue Oct 10, 2017 · 13 comments
Closed

Caffe compile error #58

foqin opened this issue Oct 10, 2017 · 13 comments

Comments

@foqin
Copy link

foqin commented Oct 10, 2017

[ 83%] Building CXX object src/caffe/CMakeFiles/caffe.dir/util/channel.cpp.o
[ 83%] Building CXX object src/caffe/CMakeFiles/caffe.dir/util/cudnn.cpp.o
[ 84%] Building CXX object src/caffe/CMakeFiles/caffe.dir/util/db.cpp.o
[ 84%] Building CXX object src/caffe/CMakeFiles/caffe.dir/util/db_leveldb.cpp.o
[ 86%] Building CXX object src/caffe/CMakeFiles/caffe.dir/util/db_lmdb.cpp.o
[ 86%] Building CXX object src/caffe/CMakeFiles/caffe.dir/util/im2col.cpp.o
[ 87%] Building CXX object src/caffe/CMakeFiles/caffe.dir/util/insert_splits.cpp.o
[ 87%] Building CXX object src/caffe/CMakeFiles/caffe.dir/util/io.cpp.o
[ 87%] Building CXX object src/caffe/CMakeFiles/caffe.dir/util/math_functions.cpp.o
[ 88%] Building CXX object src/caffe/CMakeFiles/caffe.dir/util/mpi_functions.cpp.o
[ 88%] make[2]: *** No rule to make target /path/to/cudnn/lib64/libcudnn.so', needed by lib/libcaffe.so'. Stop.
make[2]: *** Waiting for unfinished jobs....
Building CXX object src/caffe/CMakeFiles/caffe.dir/util/upgrade_proto.cpp.o
make[1]: *** [src/caffe/CMakeFiles/caffe.dir/all] Error 2
make: *** [all] Error 2

@Cysu
Copy link
Collaborator

Cysu commented Oct 10, 2017

When cmake, please replace the /path/to part with your real path to the cudnn directory.

@foqin
Copy link
Author

foqin commented Oct 11, 2017

Thank you for your help! But, I have some problem like this

#warning "Using deprecated NumPy API, disable it by "
^
c++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -D_FORTIFY_SOURCE=2 -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security build/temp.linux-x86_64-2.7/nms/nms_kernel.o build/temp.linux-x86_64-2.7/nms/gpu_nms.o -L/usr/local/cuda/lib64 -Wl,-R/usr/local/cuda/lib64 -lcudart -o /home/foqin/person_search-master/lib/nms/gpu_nms.so
rm -rf build
foqin@grus:~/person_search-master$ python tools/demo.py --gpu 0
Traceback (most recent call last):
File "tools/demo.py", line 17, in
import caffe
File "/home/foqin/person_search-master/tools/../caffe/python/caffe/init.py", line 1, in
from .pycaffe import Net, SGDSolver
File "/home/foqin/person_search-master/tools/../caffe/python/caffe/pycaffe.py", line 13, in
from ._caffe import Net, SGDSolver
ImportError: No module named _caffe

@Cysu
Copy link
Collaborator

Cysu commented Oct 11, 2017

Did you compile the caffe successfully? Please check if there is caffe/build/install/bin/caffe.

@XinshaoWang
Copy link

@Cysu Hello, I use cuda-8.0, cudnn-8.0-linux-v5.1, all the dependencies are installed. But when I run the build code as you list, errors happened. The error information is listed:

[ 5%] Building NVCC (Device) object src/caffe/CMakeFiles/cuda_compile.dir/layers/cuda_compile_generated_cudnn_conv_layer.cu.o
/home/amos/person_search/caffe/include/caffe/util/cudnn.hpp(107): error: too few arguments in function call

1 error detected in the compilation of "/tmp/tmpxft_0000133a_00000000-5_im2col.cpp4.ii".
CMake Error at cuda_compile_generated_im2col.cu.o.cmake:266 (message):
Error generating file
/home/amos/person_search/caffe/build/src/caffe/CMakeFiles/cuda_compile.dir/util/./cuda_compile_generated_im2col.cu.o

src/caffe/CMakeFiles/caffe.dir/build.make:70: recipe for target 'src/caffe/CMakeFiles/cuda_compile.dir/util/cuda_compile_generated_im2col.cu.o' failed
make[2]: *** [src/caffe/CMakeFiles/cuda_compile.dir/util/cuda_compile_generated_im2col.cu.o] Error 1
make[2]: *** Waiting for unfinished jobs....
/home/amos/person_search/caffe/include/caffe/util/cudnn.hpp(107): error: too few arguments in function call

/home/amos/person_search/caffe/include/caffe/util/cudnn.hpp(107): error: too few arguments in function call

1 error detected in the compilation of "/tmp/tmpxft_00001343_00000000-5_labeled_matching_layer.cpp4.ii".
CMake Error at cuda_compile_generated_labeled_matching_layer.cu.o.cmake:266 (message):
Error generating file
/home/amos/person_search/caffe/build/src/caffe/CMakeFiles/cuda_compile.dir/layers/./cuda_compile_generated_labeled_matching_layer.cu.o

src/caffe/CMakeFiles/caffe.dir/build.make:91: recipe for target 'src/caffe/CMakeFiles/cuda_compile.dir/layers/cuda_compile_generated_labeled_matching_layer.cu.o' failed
make[2]: *** [src/caffe/CMakeFiles/cuda_compile.dir/layers/cuda_compile_generated_labeled_matching_layer.cu.o] Error 1

@Cysu
Copy link
Collaborator

Cysu commented Oct 19, 2017

Could you please show me the cmake command you used?

@XinshaoWang
Copy link

XinshaoWang commented Oct 19, 2017

@Cysu Thanks, The commands I used are as follows:
cd caffe
mkdir build && cd build
cmake .. -DUSE_MPI=ON -DCUDNN_INCLUDE=/home/amos/cudnn-8.0-linux-x64-v5.1/include -DCUDNN_LIBRARY=/home/amos/cudnn-8.0-linux-x64-v5.1/lib64/libcudnn.so
make -j8 && make install
cd ../..

@XinshaoWang
Copy link

@Cysu
I could not build caffe successfully using cudnn v5.1 (I downloaded it and linked it by cmake command) or cudnn v6.0(which I used for py-faster-rcnn, combined in cuda as default cudnn version)

When I build caffe without cuDNN library support by setting USE_CUDNN OFF in the CMakeLists.txt, I build caffe successfully.

Could you please tell me how to build it with cudnn support? Thanks very much.

@XiaoDin9
Copy link

大佬,跟着你的步骤一步步向下做的,结果打编译caffe的时候出现了如下的问题,百度和google了一下还是找不到解决的方法,请指教一下下,谢啦!
通过在ubunt14.04中运行这个命令:cmake .. -DUSE_MPI=ON -DCUDNN_INCLUDE=/usr/local/cuda/include -DCUDNN_LIBRARY=/usr/local/cuda/lib64/libcudnn.so 如下的错误,并且我的cudnn5.1的include和lib64都放到/usr/local/cuda这个目录下的。
CMake Error: The source directory "/home/group2/person_search-master" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.

@Cysu
Copy link
Collaborator

Cysu commented Oct 25, 2017

@XinshaoWang Duplicates with threads in #51. Already solved.

@XiaoDin9 Please follow the README to run cd caffe && mkdir build && cd build before cmake.

@Cysu
Copy link
Collaborator

Cysu commented Oct 25, 2017

@foqin Any luck on your original issue?

@Cysu
Copy link
Collaborator

Cysu commented Dec 29, 2017

@foqin Please feel free to reopen the issue if there are further problems.

@Cysu Cysu closed this as completed Dec 29, 2017
@sanabouchama
Copy link

i have the same problem using this commande :
MacBook-Pro-de-admin:build admin$ make -jsysctl -n hw.logicalcpu
[ 12%] Performing build step for 'openpose_lib'
[ 1%] Built target caffeproto
Consolidate compiler generated dependencies of target caffe
[ 1%] Building CXX object src/caffe/CMakeFiles/caffe.dir/util/io.cpp.o
/Users/admin/openpose_build/openpose/3rdparty/caffe/src/caffe/util/io.cpp:66:57: error: too many arguments to function call, expected single argument 'total_bytes_limit', have 2 arguments
coded_input->SetTotalBytesLimit(kProtoReadBytesLimit, 536870912);

/usr/local/include/google/protobuf/io/coded_stream.h:406:8: note: 'SetTotalBytesLimit' declared here
void SetTotalBytesLimit(int total_bytes_limit);
     ^
1 error generated.
make[5]: *** [src/caffe/CMakeFiles/caffe.dir/util/io.cpp.o] Error 1
make[4]: *** [src/caffe/CMakeFiles/caffe.dir/all] Error 2
make[3]: *** [all] Error 2
make[2]: *** [caffe/src/openpose_lib-stamp/openpose_lib-build] Error 2
make[1]: *** [CMakeFiles/openpose_lib.dir/all] Error 2
make: *** [all] Error 2

any solution  please

@aghiuru
Copy link

aghiuru commented Jun 15, 2022

@sanabouchama You are using a newer version of protobuf. Commenting out the second parameter in https://github.com/CMU-Perceptual-Computing-Lab/caffe/blob/b5ede488952e40861e84e51a9f9fd8fe2395cc8a/src/caffe/util/io.cpp#L57 worked for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants