BVLC / caffe

Caffe: a fast open framework for deep learning.
http://caffe.berkeleyvision.org/
Other
34.01k stars 18.71k forks source link

Python3 Caffe build failed because of protobuf errors #6898

Closed spurani closed 4 years ago

spurani commented 4 years ago

6392 # Issue summary

I was building caffe and I got these errors. I can import protobuf into python 3 interpreter. Can anyone please guide me through this. I am really excited to learn this concept of Caffe. Any suggestion or advice will definitely help me . I followed the bottom guide for building and installing protobuf from source. Please feel to reach out if you require more information. I have also exported protobuf path.Also I am trying to build Caffe then build tensorflow and build digits entirely on python 3. I really tried looking up online for some relevant sources which can help me build digits entirely on python3 but I didn't come across any.It would be great if anyone is referring to something. I am currently referring to https://github.com/adeelz92/Install-Caffe-on-Ubuntu-16.04-Python-3

Steps to reproduce

Dependencies These Deb packages must be installed to build Protobuf 3 sudo apt-get install autoconf automake libtool curl make g++ git python-dev python-setuptools unzip Download Source DIGITS is currently compatiable with Protobuf 3.2.x example location - can be customized export PROTOBUF_ROOT=~/protobuf git clone https://github.com/google/protobuf.git $PROTOBUF_ROOT -b '3.2.x' Building Protobuf cd $PROTOBUF_ROOT ./autogen.sh ./configure make "-j$(nproc)" make install ldconfig cd python python setup.py install --cpp_implementation This will ensure that Protobuf 3 is installed.

.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::WireFormatLite::UInt32Size(google::protobuf::RepeatedField const&)' .build_release/lib/libcaffe.so: undefined reference to google::protobuf::internal::WireFormatLite::WriteFloatArray(float const, int, google::protobuf::io::CodedOutputStream)' .build_release/lib/libcaffe.so: undefined reference to google::protobuf::io::CodedInputStream::ReadVarint64Fallback()' .build_release/lib/libcaffe.so: undefined reference to google::protobuf::io::CodedOutputStream::default_serializationdeterministic' .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::internal::WireFormat::ReadPackedEnumPreserveUnknowns(google::protobuf::io::CodedInputStream, unsigned int, bool ()(int), google::protobuf::UnknownFieldSet, google::protobuf::RepeatedField)' .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::Int32Size(google::protobuf::RepeatedField const&)' .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::io::CodedOutputStream::WriteVarint64SlowPath(unsigned long)' .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::CodedOutputStream::WriteVarint32SlowPath(unsigned int)' .build_release/lib/libcaffe.so: undefined reference to google::protobuf::internal::InitProtobufDefaults()' .build_release/lib/libcaffe.so: undefined reference to google::protobuf::Arena::AllocateAligned(std::type_info const, unsigned long)' .build_release/lib/libcaffe.so: undefined reference to google::protobuf::io::CodedInputStream::ReadLengthAndPushLimit()' .build_release/lib/libcaffe.so: undefined reference to google::protobuf::internal::fixed_address_empty_string[abi:cxx11]' .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::WriteDoubleArray(double const, int, google::protobuf::io::CodedOutputStream)' .build_release/lib/libcaffe.so: undefined reference to google::protobuf::io::CodedInputStream::ReadVarintSizeAsIntFallback()' .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::internal::AssignDescriptors(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, google::protobuf::internal::MigrationSchema const, google::protobuf::Message const const, unsigned int const, google::protobuf::MessageFactory, google::protobuf::Metadata, google::protobuf::EnumDescriptor const, google::protobuf::ServiceDescriptor const)' .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::ArenaStringPtr::AssignWithDefault(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const, google::protobuf::internal::ArenaStringPtr)' collect2: error: ld returned 1 exit status Makefile:635: recipe for target '.build_release/tools/upgrade_net_proto_text.bin' failed make: *** [.build_release/tools/upgrade_net_proto_text.bin] Error 1

Tried solutions

Tried reinstalling protobuf

System configuration

Issue checklist

spurani commented 4 years ago

Fixed the issue by removing duplicate protobuf dependency installed in my system