Closed xiaoyuliu closed 6 years ago
I consider that using the opencv 2.4 is the right direction.
Might try to make clean
and make
again.
Thanks. The problem is solved using another machine to compile but I haven't figured out what the problem exactly is...
Then I met another problem when running ran_bf_build.m: Compiling nms_gpu_mex /usr/local/cuda/bin/nvcc --compile -o nms_gpu_mex.o --compiler-options -fPIC -I"/net/local-rscn/matlab2016b/extern/include " -I/usr/local/cuda/include -I/usr/local/cuda/samples/common/inc "functions/nms/nms_gpu_mex.cu" /bin/bash: /usr/local/cuda/bin/nvcc: No such file or directory mex -outdir bin nms_gpu_mex.o -L/usr/local/cuda/lib64 -lcudart Building with 'gcc'. Error using mex gcc: error: nms_gpu_mex.o: No such file or directory
Error in nvmex (line 48) eval(mexCommandLine);
Error in rpn_bf_build (line 23) nvmex('functions/nms/nms_gpu_mex.cu', 'bin');
"/usr/local/cuda" is actually not my path to CUDA, and when making the caffe, I have specified the correct path to CUDA in Makefile.config. However I can't find any file in RPN_BF to explicitly define the path to CUDA. Can you give me some insight?
Thank you again.
I guess I solve the problem myself, which is really interesting. In case that someone has the same problem, here is the solution:
If mexcuda has trouble locating the NVIDIA compiler (nvcc), it might be installed in a non-default location. You can specify the location of nvcc on your system by storing it in the environment variable MW_NVCC_PATH. You can set this variable using the MATLAB setenv command.
setenv('MW_NVCC_PATH','/usr/local/CUDA/bin')
from https://www.mathworks.com/help/distcomp/run-mex-functions-containing-cuda-code.html
@zhangliliang What's more, the line 'toolboxCompile();' in the file rpn_bf_build.m is really confusing because there's no such a file under the path and even the path you add still contains no file like this.
Can you explain? Thanks.
Hi.
toolboxCompile
is in this path external/toolbox
. And this path is added when startup().
@zhangliliang Thank you. Sure, I notice that, but since according to https://github.com/ShaoqingRen/faster_rcnn, rpn_bf_build.m will be run before startup.m, perhaps there's a reminder needed.
Hi,
Thanks for the effort. I tried to make this caffe on my machine, but it keeps showing error:
CXX/LD -o .build_release/examples/cifar10/convert_cifar_data.bin .build_release/lib/libcaffe.so: undefined reference to >&, std::vector<int, std::allocator > const&)'
.build_release/lib/libcaffe.so: undefined reference to >&, std::vector<int, std::allocator > const&)'
.build_release/lib/libcaffe.so: undefined reference to [.build_release/tools/caffe.bin] Error 1
.build_release/lib/libcaffe.so: undefined reference to >&, std::vector<int, std::allocator > const&)'
.build_release/lib/libcaffe.so: undefined reference to >&, std::vector<int, std::allocator > const&)'
.build_release/lib/libcaffe.so: undefined reference to [.build_release/examples/cifar10/convert_cifar_data.bin] Error 1
.build_release/lib/libcaffe.so: undefined reference to >&, std::vector<int, std::allocator > const&)'
.build_release/lib/libcaffe.so: undefined reference to
cv::_OutputArray::_OutputArray(cv::Mat&)' .build_release/lib/libcaffe.so: undefined reference to
cv::imencode(std::string const&, cv::_InputArray const&, std::vector<unsigned char, std::allocatorcv::_InputArray::_InputArray(cv::Mat const&)' .build_release/lib/libcaffe.so: undefined reference to
cv::imread(std::string const&, int)' .build_release/lib/libcaffe.so: undefined reference tovtable for cv::_InputArray' collect2: error: ld returned 1 exit status make: *** [.build_release/tools/convert_imageset.bin] Error 1 make: *** Waiting for unfinished jobs.... .build_release/lib/libcaffe.so: undefined reference to
cv::_OutputArray::_OutputArray(cv::Mat&)' .build_release/lib/libcaffe.so: undefined reference tocv::imencode(std::string const&, cv::_InputArray const&, std::vector<unsigned char, std::allocator<unsigned char> >&, std::vector<int, std::allocator<int> > const&)' .build_release/lib/libcaffe.so: undefined reference to
cv::_InputArray::_InputArray(cv::Mat const&)' .build_release/lib/libcaffe.so: undefined reference tocv::imread(std::string const&, int)' .build_release/lib/libcaffe.so: undefined reference to
vtable for cv::_InputArray' collect2: error: ld returned 1 exit status make: [.build_release/tools/compute_image_mean.bin] Error 1 .build_release/lib/libcaffe.so: undefined reference tocv::_OutputArray::_OutputArray(cv::Mat&)' .build_release/lib/libcaffe.so: undefined reference to
cv::imencode(std::string const&, cv::_InputArray const&, std::vector<unsigned char, std::allocatorcv::_InputArray::_InputArray(cv::Mat const&)' .build_release/lib/libcaffe.so: undefined reference to
cv::imread(std::string const&, int)' .build_release/lib/libcaffe.so: undefined reference to `vtable for cv::_InputArray' collect2: error: ld returned 1 exit status make:cv::_OutputArray::_OutputArray(cv::Mat&)' .build_release/lib/libcaffe.so: undefined reference to
cv::imencode(std::string const&, cv::_InputArray const&, std::vector<unsigned char, std::allocatorcv::_InputArray::_InputArray(cv::Mat const&)' .build_release/lib/libcaffe.so: undefined reference to
cv::imread(std::string const&, int)' .build_release/lib/libcaffe.so: undefined reference tovtable for cv::_InputArray' collect2: error: ld returned 1 exit status make: *** [.build_release/tools/extract_features.bin] Error 1 .build_release/lib/libcaffe.so: undefined reference to
cv::_OutputArray::_OutputArray(cv::Mat&)' .build_release/lib/libcaffe.so: undefined reference tocv::imencode(std::string const&, cv::_InputArray const&, std::vector<unsigned char, std::allocator<unsigned char> >&, std::vector<int, std::allocator<int> > const&)' .build_release/lib/libcaffe.so: undefined reference to
cv::_InputArray::_InputArray(cv::Mat const&)' .build_release/lib/libcaffe.so: undefined reference tocv::imread(std::string const&, int)' .build_release/lib/libcaffe.so: undefined reference to
vtable for cv::_InputArray' collect2: error: ld returned 1 exit status make: [.build_release/tools/upgrade_net_proto_binary.bin] Error 1 .build_release/lib/libcaffe.so: undefined reference tocv::_OutputArray::_OutputArray(cv::Mat&)' .build_release/lib/libcaffe.so: undefined reference to
cv::imencode(std::string const&, cv::_InputArray const&, std::vector<unsigned char, std::allocatorcv::_InputArray::_InputArray(cv::Mat const&)' .build_release/lib/libcaffe.so: undefined reference to
cv::imread(std::string const&, int)' .build_release/lib/libcaffe.so: undefined reference to `vtable for cv::_InputArray' collect2: error: ld returned 1 exit status make:cv::_OutputArray::_OutputArray(cv::Mat&)' .build_release/lib/libcaffe.so: undefined reference to
cv::imencode(std::string const&, cv::_InputArray const&, std::vector<unsigned char, std::allocatorcv::_InputArray::_InputArray(cv::Mat const&)' .build_release/lib/libcaffe.so: undefined reference to
cv::imread(std::string const&, int)' .build_release/lib/libcaffe.so: undefined reference tovtable for cv::_InputArray' collect2: error: ld returned 1 exit status make: *** [.build_release/tools/upgrade_net_proto_text.bin] Error 1 .build_release/lib/libcaffe.so: undefined reference to
cv::_OutputArray::_OutputArray(cv::Mat&)' .build_release/lib/libcaffe.so: undefined reference tocv::imencode(std::string const&, cv::_InputArray const&, std::vector<unsigned char, std::allocator<unsigned char> >&, std::vector<int, std::allocator<int> > const&)' .build_release/lib/libcaffe.so: undefined reference to
cv::_InputArray::_InputArray(cv::Mat const&)' .build_release/lib/libcaffe.so: undefined reference tocv::imread(std::string const&, int)' .build_release/lib/libcaffe.so: undefined reference to
vtable for cv::_InputArray' collect2: error: ld returned 1 exit status make: *** [.build_release/examples/siamese/convert_mnist_siamese_data.bin] Error 1I learnt someone encountering the same problem because they were using OPENCV3.0 and had to set the OPENCV_VERSION variable or add opencv_imgcodecs to the LIBRARIES. However I'm quite sure I'm using OPENCV 2.4.11 now, and even I play these tricks the error still shows.
Can anyone provide some suggestion? Appreciate it.