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

person search project failed to compile caffe with cudnn #46

Closed
tonywang-sh opened this issue Aug 7, 2017 · 5 comments
Closed

person search project failed to compile caffe with cudnn #46

tonywang-sh opened this issue Aug 7, 2017 · 5 comments

Comments

@tonywang-sh
Copy link

I met an issue about compiling this caffe branch with cudnn. as mentioned in person search wiki. it used cudnn-5.1, but compiling this caffe branch failed with both cuda 8.0's and cuda7.5's cudnn 5.1. what about the exact cudnn version for compiling this caffe branch.

the below is a part of error message,
CXX .build_release/src/caffe/proto/caffe.pb.cc
CXX src/caffe/blob.cpp
CXX src/caffe/common.cpp
CXX src/caffe/data_transformer.cpp
CXX src/caffe/layer_factory.cpp
CXX src/caffe/layers/absval_layer.cpp
CXX src/caffe/layers/accuracy_layer.cpp
CXX src/caffe/layers/argmax_layer.cpp
CXX src/caffe/layers/base_conv_layer.cpp
CXX src/caffe/layers/base_data_layer.cpp
CXX src/caffe/layers/batch_reduction_layer.cpp
CXX src/caffe/layers/bias_layer.cpp
CXX src/caffe/layers/bn_layer.cpp
CXX src/caffe/layers/bnll_layer.cpp
CXX src/caffe/layers/concat_layer.cpp
CXX src/caffe/layers/contrastive_loss_layer.cpp
CXX src/caffe/layers/cudnn_bn_layer.cpp
CXX src/caffe/layers/conv_layer.cpp
CXX src/caffe/layers/cudnn_conv_layer.cpp
CXX src/caffe/layers/cudnn_pooling_layer.cpp
src/caffe/common.cpp:146:1: error: ‘Caffe’ does not name a type
Caffe::Caffe()
^
src/caffe/common.cpp:177:1: error: ‘Caffe’ does not name a type
Caffe::~Caffe() {
^
src/caffe/common.cpp:184:6: error: ‘Caffe’ has not been declared
void Caffe::set_random_seed(const unsigned int seed) {
^
src/caffe/common.cpp: In function ‘void set_random_seed(unsigned int)’:
src/caffe/common.cpp:187:11: error: ‘Get’ was not declared in this scope
if (Get().curand_generator_) {
^
In file included from ./include/caffe/common.hpp:34:0,
from src/caffe/common.cpp:5:
src/caffe/common.cpp:188:70: error: ‘curand_generator’ was not declared in this scope
CURAND_CHECK(curandSetPseudoRandomGeneratorSeed(curand_generator(),
^
./include/caffe/util/device_alternate.hpp:64:29: note: in definition of macro ‘CURAND_CHECK’
curandStatus_t status = condition;
^
src/caffe/common.cpp:190:60: error: ‘curand_generator’ was not declared in this scope
CURAND_CHECK(curandSetGeneratorOffset(curand_generator(), 0));
^
./include/caffe/util/device_alternate.hpp:64:29: note: in definition of macro ‘CURAND_CHECK’
curandStatus_t status = condition;
^
src/caffe/common.cpp:199:7: error: ‘Get’ was not declared in this scope
Get().random_generator_.reset(new RNG(seed));
^
src/caffe/common.cpp:199:37: error: expected type-specifier before ‘RNG’
Get().random_generator_.reset(new RNG(seed));
^
src/caffe/common.cpp: At global scope:
src/caffe/common.cpp:202:6: error: ‘Caffe’ has not been declared
void Caffe::SetDevice(const int device_id) {

@Cysu
Copy link
Collaborator

Cysu commented Aug 7, 2017

Did you build in CPU_ONLY mode? It is a known issue #21. Please try to compile it with -DUSE_MPI=ON.

@tonywang-sh
Copy link
Author

I tried CPU_ONLY mode with -DUSE_MPI=ON, there are still some error messages, my OS is centos 7.

CXX src/caffe/layers/deconv_layer.cpp
CXX src/caffe/layers/dropout_layer.cpp
src/caffe/common.cpp:103:1: error: ‘Caffe’ does not name a type
Caffe::Caffe()
^
src/caffe/common.cpp:106:1: error: ‘Caffe’ does not name a type
Caffe::~Caffe() { }
^
src/caffe/common.cpp:108:6: error: ‘Caffe’ has not been declared
void Caffe::set_random_seed(const unsigned int seed) {
^
src/caffe/common.cpp: In function ‘void set_random_seed(unsigned int)’:
src/caffe/common.cpp:110:7: error: ‘Get’ was not declared in this scope
Get().random_generator_.reset(new RNG(seed));
^
src/caffe/common.cpp:110:37: error: expected type-specifier before ‘RNG’
Get().random_generator_.reset(new RNG(seed));
^
src/caffe/common.cpp: At global scope:
src/caffe/common.cpp:113:6: error: ‘Caffe’ has not been declared
void Caffe::SetDevice(const int device_id) {
^
src/caffe/common.cpp:117:6: error: ‘Caffe’ has not been declared
void Caffe::DeviceQuery() {
^
src/caffe/common.cpp:122:7: error: ‘Caffe’ has not been declared
class Caffe::RNG::Generator {
^
src/caffe/common.cpp:122:29: error: expected unqualified-id before ‘{’ token
class Caffe::RNG::Generator {
^
make: *** [.build_release/src/caffe/common.o] Error 1
make: *** Waiting for unfinished jobs....

@Cysu
Copy link
Collaborator

Cysu commented Aug 7, 2017

Well, #25 seems to be the same issue. Please refer to that thread, and I will ask the author how he has solved it.

@tonywang-sh
Copy link
Author

@Cysu in order to compile this caffe branch, can we use make with Makefile.config directly. If so, how to set USE_MPI option into compiling process

@Cysu
Copy link
Collaborator

Cysu commented Aug 8, 2017

@TonnyWang Sorry but the caffe cannot be compiled with Makefile.config. We must use cmake for compiling. Please try the following commands.

cd caffe
mkdir build && cd build
cmake .. -DUSE_MPI=ON -DCUDNN_INCLUDE=/path/to/cudnn/include -DCUDNN_LIBRARY=/path/to/cudnn/lib64/libcudnn.so
make -j8 && make install
cd ../..

@Cysu Cysu closed this as completed Sep 14, 2017
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

2 participants