caffe.set_mode_cpu() error?

194 views
Skip to first unread message

Kevin George

unread,
Dec 20, 2016, 3:56:59 AM12/20/16
to Caffe Users
Actually I built caffe with only cpu support. Is the command 'caffe.set_mode_cpu() ' only used when we have built with gpu support so that we can switch to cpu when needed? I thought I might need it just to make sure that Caffe is using my cpu but I guess the build takes care of that. Also is this command required even when I have built with cpu support only?

Error I get-
WARNING: Logging before InitGoogleLogging() is written to STDERR
E1220 14:26:00.833413 17923 common.cpp:117] Cannot create Cublas handle. Cublas won't be available.
E1220 14:26:00.833684 17923 common.cpp:124] Cannot create Curand generator. Curand won't be available.
E1220 14:26:00.833871 17923 common.cpp:128] Cannot create cuDNN handle. cuDNN won't be available.
F1220 14:26:00.834089 17923 _caffe.cpp:61] Check failed: error == cudaSuccess (35 vs. 0)  CUDA driver version is insufficient for CUDA runtime version
*** Check failure stack trace: ***
Aborted (core dumped)

Shai Bagon

unread,
Dec 20, 2016, 6:51:59 AM12/20/16
to Caffe Users
this question was also asked in stackoverflow

Kevin George

unread,
Dec 20, 2016, 7:49:45 PM12/20/16
to Caffe Users
So I have used this link where I have used the command "cmake -DCPU_ONLY=ON". But even after building with this successfully, I am still getting the same gpu error.

Kevin George

unread,
Dec 21, 2016, 5:50:07 AM12/21/16
to Caffe Users
So does anyone know why the cuda error still persists even though I've built Caffe with CPU only?

Suyog Trivedi

unread,
Dec 21, 2016, 6:18:16 AM12/21/16
to Caffe Users
Hi kevin,
            Could you plz post your "Makefile.Config" file. Would be better to resolve the issue.

Kevin George

unread,
Dec 21, 2016, 6:46:16 AM12/21/16
to Caffe Users
I hate attached the file. If you would like to see further developments on this question, you can check it out on this stackoverflow link.
Makefile.config

Suyog Trivedi

unread,
Dec 21, 2016, 7:18:14 AM12/21/16
to Caffe Users
Hi,
I have never used CMAKE to build caffe, I find editing Makefile much easier option. If you still want to use CMAKE try this link

other wise you can use MAKE. Use the attached file for MAKE. If you have ever used make for caffe, do not forget to do 'make clean' inside caffe root folder before building it again. 

for python layers -  WITH_PYTHON_LAYER := 1 should be uncommented inside Makefile.config.
Makefile.config

Kevin George

unread,
Dec 26, 2016, 12:41:58 PM12/26/16
to Caffe Users
Hi guys, it's almost been a week but I'm still stuck with compiling Caffe. I followed Suyog's instruction of using make to compile caffe but I'm getting the below error.
build_release/tools/extract_features.o: In function `google::protobuf::RepeatedField<float>::Reserve(int)':
extract_features.cpp:(.text._ZN6google8protobuf13RepeatedFieldIfE7ReserveEi[_ZN6google8protobuf13RepeatedFieldIfE7ReserveEi]+0x59): undefined reference to `google::protobuf::Arena::All'
.build_release/tools/extract_features.o: In function `int feature_extraction_pipeline<float>(int, char**)':
extract_features.cpp:(.text._Z27feature_extraction_pipelineIfEiiPPc[_Z27feature_extraction_pipelineIfEiiPPc]+0xc41): undefined reference to `google::protobuf::internal::fixed_address_e'
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::internal::RegisterAllTypes(google::protobuf::Metadata const*, int)'
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::io::CodedInputStream::ReadVarintSizeAsIntFallback()'
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::internal::InitProtobufDefaults()'
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::io::CodedInputStream::ReadVarint64Fallback()'
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::io::CodedInputStream::ReadTagFallback(unsigned int)'
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::io::CodedOutputStream::WriteVarint32SlowPath(unsigned int)'
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::io::CodedOutputStream::WriteVarint64SlowPath(unsigned long)'
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::internal::ArenaStringPtr::AssignWithDefault(std::string const*, google::protobuf::internal::ArenaStringPtr)'
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::io::CodedInputStream::ReadLengthAndPushLimit()'
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::io::CodedInputStream::BytesUntilTotalBytesLimit() const'
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::io::CodedInputStream::CheckEntireMessageConsumedAndPopLimit(int)'
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(int, std::string const&, google::protobuf::io::CodedOutputStr'
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::Arena::AddListNode(void*, void (*)(void*))'
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::io::CodedInputStream::IncrementRecursionDepthAndPushLimit(int)'
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(int, std::string const&, google::protobuf::io::CodedOutputSt'
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::io::CodedInputStream::ReadVarint32Fallback(unsigned int)'
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::internal::RepeatedPtrFieldBase::InternalExtend(int)'
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::internal::AssignDescriptors(std::string const&, google::protobuf::internal::MigrationSchema const*, google::pr'
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::io::CodedOutputStream::WriteStringWithSizeToArray(std::string const&, unsigned char*)'
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::io::CodedInputStream::DecrementRecursionDepthAndPopLimit(int)'
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::internal::WireFormat::ReadPackedEnumPreserveUnknowns(google::protobuf::io::CodedInputStream*, unsigned int, bo'
collect2: error: ld returned 1 exit status
make: *** [.build_release/tools/extract_features.bin] Error 1


 

I am using python 3.4.3 with Opencv 3.2.0 on Ubuntu 14.04lts. My protobuf version is 3.1.0. I manually upgraded the protobuf from 2.5.0 to solve one error(I can't remember) but now I'm getting this. I have uploaded my Makefile. I have searched online for this error but I'm sadly not able to resolve it.
Makefile.config
Reply all
Reply to author
Forward
0 new messages