Reputation: 1
I have been trying for some days to make faster RCNN work in a laptop with GPU(Quadro K5100M). I was able to run the demo.py in a laptop with only CPU. I am using CUDA 8 and CuDnn 4 and caffe build works but the build process of caffe in faster rcnn does not. I have CuDnn commented out now because of some other errors. Can anyone give me some suggestions.
I get this error during make -j8 && make pycaffe.
.build_release/tools/extract_features.o: In function
int feature_extraction_pipeline(int, char**)':
extract_features.cpp:(.text._Z27feature_extraction_pipelineIfEiiPPc[_Z27feature_extraction_pipelineIfEiiPPc]+0x162): undefined reference to caffe::Net<float>::Net(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, caffe::Phase, caffe::Net<float> const*)'
collect2: error: ld returned 1 exit status
CXX/LD -o .build_release/examples/mnist/convert_mnist_data.bin
Makefile:607: recipe for target '.build_release/tools/extract_features.bin' failed
make: *** [.build_release/tools/extract_features.bin] Error 1
make: *** Waiting for unfinished jobs....
.build_release/tools/caffe.o: In function
test()':
caffe.cpp:(.text+0x1157): undefined reference to caffe::Net<float>::Net(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, caffe::Phase, caffe::Net<float> const*)'
.build_release/tools/caffe.o: In function
train()':
caffe.cpp:(.text+0x2a3e): undefined reference to caffe::P2PSync<float>::P2PSync(boost::shared_ptr<caffe::Solver<float> >, caffe::P2PSync<float>*, caffe::SolverParameter const&)'
caffe.cpp:(.text+0x2a6b): undefined reference to
caffe::P2PSync::run(std::vector > const&)'
caffe.cpp:(.text+0x2a73): undefined reference to caffe::P2PSync<float>::~P2PSync()'
caffe.cpp:(.text+0x3c53): undefined reference to
caffe::P2PSync::~P2PSync()'
caffe.cpp:(.text+0x3f45): undefined reference to caffe::P2PSync<float>::~P2PSync()'
.build_release/tools/caffe.o: In function
time()':
caffe.cpp:(.text+0x4136): undefined reference to caffe::Net<float>::Net(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, caffe::Phase, caffe::Net<float> const*)'
caffe.cpp:(.text+0x44ef): undefined reference to
caffe::Layer::Lock()'
caffe.cpp:(.text+0x45ed): undefined reference to caffe::Layer<float>::Unlock()'
collect2: error: ld returned 1 exit status
Makefile:607: recipe for target '.build_release/tools/caffe.bin' failed
This is my makefile
# USE_CUDNN := 1
# CPU-only switch (uncomment to build without GPU support).
# CPU_ONLY := 1
# Uncomment if you're using OpenCV 3
OPENCV_VERSION := 3
# CUDA directory contains bin/ and lib/ directories that we need.
CUDA_DIR := /usr/local/cuda-8.0
# On Ubuntu 14.04, if cuda tools are installed via
# "sudo apt-get install nvidia-cuda-toolkit" then use this instead:
# CUDA_DIR := /usr
CUDA_ARCH := -gencode arch=compute_20,code=sm_20 \
-gencode arch=compute_20,code=sm_21 \
-gencode arch=compute_30,code=sm_30 \
-gencode arch=compute_35,code=sm_35 \
-gencode arch=compute_50,code=sm_50 \
-gencode arch=compute_50,code=compute_50
BLAS := atlas
#BLAS := open
# NOTE: this is required only if you will compile the python interface.
# We need to be able to find Python.h and numpy/arrayobject.h.
PYTHON_INCLUDE := /usr/include/python2.7 \
/usr/local/lib/python2.7/dist-packages/numpy/core/include \
/usr/local/lib/python2.7/dist-packages/numpy/core/include/numpy
# We need to be able to find libpythonX.X.so or .dylib.
PYTHON_LIB := /usr/lib
# PYTHON_LIB := $(ANACONDA_HOME)/lib
# Uncomment to support layers written in Python (will link against Python libs)
WITH_PYTHON_LAYER := 1
# Whatever else you find you need goes here.
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial /usr/include/opencv /usr/local/cuda-8.0/include
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib /usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/hdf5/serial /usr/local/share/OpenCV /usr/local/cuda-8.0/lib64
# N.B. both build and distribute dirs are cleared on `make clean`
BUILD_DIR := build
DISTRIBUTE_DIR := distribute
# Uncomment for debugging. Does not work on OSX due to https://github.com/BVLC/caffe/issues/171
# DEBUG := 1
# The ID of the GPU that 'make runtest' will use to run unit tests.
TEST_GPUID := 0
# enable pretty build (comment to see full commands)
Q ?= @
Upvotes: 0
Views: 310
Reputation: 3408
I had the same error because my library path (/usr/lib/) contained a previous build of libcaffe.so. Removing it fixed the problem.
Upvotes: 0