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

Fail to compile caffe #25

Closed
22wei22 opened this issue Apr 20, 2017 · 9 comments
Closed

Fail to compile caffe #25

22wei22 opened this issue Apr 20, 2017 · 9 comments

Comments

@22wei22
Copy link

22wei22 commented Apr 20, 2017

\u2018 and \u2019 means ' '
\u2018 and \u2019是引号,复制过来的时候显示错误
CXX src/caffe/common.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: \u2018Caffe\u2019 has not been declared
void Caffe::set_random_seed(const unsigned int seed) {
^
src/caffe/common.cpp: In function \u2018void set_random_seed(unsigned int)\u2019:
src/caffe/common.cpp:187:11: error: \u2018Get\u2019 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: \u2018curand_generator\u2019 was not declared in this scope
CURAND_CHECK(curandSetPseudoRandomGeneratorSeed(curand_generator(),
^
./include/caffe/util/device_alternate.hpp:64:29: note: in definition of macro \u2018CURAND_CHECK\u2019
curandStatus_t status = condition;
^
src/caffe/common.cpp:190:60: error: \u2018curand_generator\u2019 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 \u2018CURAND_CHECK\u2019
curandStatus_t status = condition;
^
src/caffe/common.cpp:199:7: error: \u2018Get\u2019 was not declared in this scope
Get().random_generator_.reset(new RNG(seed));
^
src/caffe/common.cpp:199:37: error: expected type-specifier before \u2018RNG\u2019
Get().random_generator_.reset(new RNG(seed));
^
src/caffe/common.cpp: At global scope:
src/caffe/common.cpp:202:6: error: \u2018Caffe\u2019 has not been declared
void Caffe::SetDevice(const int device_id) {
^
src/caffe/common.cpp: In function \u2018void SetDevice(int)\u2019:
src/caffe/common.cpp:206:42: error: \u2018Get\u2019 was not declared in this scope
if (current_device == device_id && Get().cublas_handle_ && Get().curand_generator_) {
^
src/caffe/common.cpp:212:11: error: \u2018Get\u2019 was not declared in this scope
if (Get().cublas_handle_) CUBLAS_CHECK(cublasDestroy(Get().cublas_handle_));
^
src/caffe/common.cpp:213:11: error: \u2018Get\u2019 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:216:34: error: \u2018Get\u2019 was not declared in this scope
CUBLAS_CHECK(cublasCreate(&Get().cublas_handle_));
^
./include/caffe/util/device_alternate.hpp:57:29: note: in definition of macro \u2018CUBLAS_CHECK\u2019
cublasStatus_t status = condition;
^
src/caffe/common.cpp:217:43: error: \u2018Get\u2019 was not declared in this scope
CURAND_CHECK(curandCreateGenerator(&Get().curand_generator_,
^
./include/caffe/util/device_alternate.hpp:64:29: note: in definition of macro \u2018CURAND_CHECK\u2019
curandStatus_t status = condition;
^
src/caffe/common.cpp:219:55: error: \u2018Get\u2019 was not declared in this scope
CURAND_CHECK(curandSetPseudoRandomGeneratorSeed(Get().curand_generator_,
^
./include/caffe/util/device_alternate.hpp:64:29: note: in definition of macro \u2018CURAND_CHECK\u2019
curandStatus_t status = condition;
^
src/caffe/common.cpp:220:23: error: \u2018cluster_seedgen\u2019 was not declared in this scope
cluster_seedgen()));
^
./include/caffe/util/device_alternate.hpp:64:29: note: in definition of macro \u2018CURAND_CHECK\u2019
curandStatus_t status = condition;
^
src/caffe/common.cpp:220:23: note: suggested alternative:
cluster_seedgen()));
^
./include/caffe/util/device_alternate.hpp:64:29: note: in definition of macro \u2018CURAND_CHECK\u2019
curandStatus_t status = condition;
^
src/caffe/common.cpp:13:9: note: \u2018caffe::cluster_seedgen\u2019
int64_t cluster_seedgen(bool sync) {
^
src/caffe/common.cpp: At global scope:
src/caffe/common.cpp:226:6: error: \u2018Caffe\u2019 has not been declared
void Caffe::DeviceQuery() {
^
src/caffe/common.cpp:262:7: error: \u2018Caffe\u2019 has not been declared
class Caffe::RNG::Generator {
^
src/caffe/common.cpp:262:29: error: expected unqualified-id before \u2018{\u2019 token
class Caffe::RNG::Generator {
^
make: *** [.build_release/src/caffe/common.o] Error 1

@Cysu
Copy link
Collaborator

Cysu commented Apr 20, 2017

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

@22wei22
Copy link
Author

22wei22 commented Apr 21, 2017

Thanks,this problem has been solved.But I have a new question,do I need to make pycaffe? when I run the demo ,it will tell me that
File "tools/eval_test.py", line 9, in
import caffe
File "/home/lsw2/shiyan/person_search/tools/../caffe/python/caffe/init.py", line 1, in
from .pycaffe import Net, SGDSolver
File "/home/lsw2/shiyan/person_search/tools/../caffe/python/caffe/pycaffe.py", line 13, in
from ._caffe import Net, SGDSolver
ImportError: No module named _caffe
Traceback (most recent call last):
File "tools/eval_test.py", line 9, in
import caffe
File "/home/lsw2/shiyan/person_search/tools/../caffe/python/caffe/init.py", line 1, in
from .pycaffe import Net, SGDSolver
File "/home/lsw2/shiyan/person_search/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 Apr 21, 2017

Our modified caffe uses cmake for compilation, which should automatically compile the python binding. Please check the README file and follow these steps to compile the caffe:

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 ../..

@22wei22
Copy link
Author

22wei22 commented Apr 21, 2017

thanks,The problem has been solved

@Cysu Cysu closed this as completed Apr 21, 2017
@FreddyZfd
Copy link

@22wei22 I have the same problem of the python importing caffe with you. How did you do to solve the problem?

@22wei22
Copy link
Author

22wei22 commented May 2, 2017

@FreddyZfd I can not import caffe because libboost1.55 is not installed instead of installing libboost1.54

@Cysu
Copy link
Collaborator

Cysu commented May 2, 2017

@FreddyZfd On Ubuntu 14.04, you may try sudo apt-get autoremove libboost1.54* then sudo apt-get install libboost1.55-all-dev to update boost.

@Cysu
Copy link
Collaborator

Cysu commented Aug 7, 2017

@22wei22 How did you solve the original issue? #46 seems to have the same problem.

@22wei22
Copy link
Author

22wei22 commented Sep 11, 2017

Sorry,I just see it today,but i really forget how to solve it.Congratulation on your paper which is included by CVPR

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

3 participants