leovandriel / caffe2_cpp_tutorial

C++ transcripts of the Caffe2 Python tutorials and other C++ example code
BSD 2-Clause "Simplified" License
431 stars 94 forks source link

Can't build with anaconda installed caffe2 #57

Open ipchikin opened 6 years ago

ipchikin commented 6 years ago

-- The C compiler identification is AppleClang 9.0.0.9000039 -- The CXX compiler identification is AppleClang 9.0.0.9000039 -- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Looking for pthread.h -- Looking for pthread.h - found -- Looking for pthread_create -- Looking for pthread_create - found -- Found Threads: TRUE
-- Found Protobuf: /usr/local/anaconda3/lib/libprotobuf.dylib (found version "3.4.0") -- Found OpenCV: /usr/local/anaconda3 (found version "3.3.1") -- Found CURL: /usr/local/anaconda3/lib/libcurl.dylib (found version "7.58.0") ../caffe2: warning: directory does not exist. -- Configuring done -- Generating done -- Build files have been written to: /Users/chikinip/Projects/caffe2_cpp_tutorial/build downloading test image (2) ######################################################################################################################################################### 100.0% ######################################################################################################################################################### 100.0% downloading Squeezenet model (2) ######################################################################################################################################################### 100.0% ######################################################################################################################################################### 100.0% downloading MNIST train data (2) ######################################################################################################################################################### 100.0% ######################################################################################################################################################### 100.0% E0316 17:00:10.233049 2354848576 init_intrinsics_check.cc:59] CPU feature avx is present on your machine, but the Caffe2 binary is not compiled with it. It means you may not get the full speed of your CPU. E0316 17:00:10.234446 2354848576 init_intrinsics_check.cc:59] CPU feature avx2 is present on your machine, but the Caffe2 binary is not compiled with it. It means you may not get the full speed of your CPU. E0316 17:00:10.234477 2354848576 init_intrinsics_check.cc:59] CPU feature fma is present on your machine, but the Caffe2 binary is not compiled with it. It means you may not get the full speed of your CPU. downloading MNIST test data (2) ######################################################################################################################################################### 100.0% ######################################################################################################################################################### 100.0% E0316 17:00:24.738350 2354848576 init_intrinsics_check.cc:59] CPU feature avx is present on your machine, but the Caffe2 binary is not compiled with it. It means you may not get the full speed of your CPU. E0316 17:00:24.740079 2354848576 init_intrinsics_check.cc:59] CPU feature avx2 is present on your machine, but the Caffe2 binary is not compiled with it. It means you may not get the full speed of your CPU. E0316 17:00:24.740113 2354848576 init_intrinsics_check.cc:59] CPU feature fma is present on your machine, but the Caffe2 binary is not compiled with it. It means you may not get the full speed of your CPU. downloading RNN and LSTM test data (1)

=O=

downloading CNN image test data (3) -=O=# # # #
-=#=- # # #
-=#=- # # #
Scanning dependencies of target caffe2_cpp [ 1%] Building CXX object CMakeFiles/caffe2_cpp.dir/src/caffe2/util/blob.cc.o [ 3%] Building CXX object CMakeFiles/caffe2_cpp.dir/src/caffe2/util/external.pb.cc.o [ 5%] Building CXX object CMakeFiles/caffe2_cpp.dir/src/caffe2/util/model.cc.o [ 7%] Building CXX object CMakeFiles/caffe2_cpp.dir/src/caffe2/util/model.pb.cc.o /Users/chikinip/Projects/caffe2_cpp_tutorial/src/caffe2/util/model.pb.cc:144:3: error: no member named 'protobuf_external_2eproto' in namespace 'caffe2'; did you mean simply 'protobuf_external_2eproto'? ::caffe2::protobuf_external_2eproto::InitDefaults(); ^~~~~~~~~~~ protobuf_external_2eproto /Users/chikinip/Projects/caffe2_cpp_tutorial/src/caffe2/util/external.pb.h:8:11: note: 'protobuf_external_2eproto' declared here namespace protobuf_external_2eproto { ^ /Users/chikinip/Projects/caffe2_cpp_tutorial/src/caffe2/util/model.pb.cc:144:13: error: no member named 'InitDefaults' in namespace 'protobuf_external_2eproto'; did you mean simply 'InitDefaults'? ::caffe2::protobuf_external_2eproto::InitDefaults(); ^~~~~~~~~~~ InitDefaults /Users/chikinip/Projects/caffe2_cpp_tutorial/src/caffe2/util/model.pb.h:63:6: note: 'InitDefaults' declared here void InitDefaults(); ^ /Users/chikinip/Projects/caffe2_cpp_tutorial/src/caffe2/util/model.pb.cc:186:3: error: no member named 'protobuf_external_2eproto' in namespace 'caffe2'; did you mean simply 'protobuf_external_2eproto'? ::caffe2::protobuf_external_2eproto::AddDescriptors(); ^~~~~~~~~~~ protobuf_external_2eproto /Users/chikinip/Projects/caffe2_cpp_tutorial/src/caffe2/util/external.pb.h:8:11: note: 'protobuf_external_2eproto' declared here namespace protobuf_external_2eproto { ^ 3 errors generated. make[3]: [CMakeFiles/caffe2_cpp.dir/src/caffe2/util/model.pb.cc.o] Error 1 make[2]: [CMakeFiles/caffe2_cpp.dir/all] Error 2 make[1]: [all] Error 2 make: [all] Error 2

Luyang1125 commented 6 years ago

I got a similar problem when using Anaconda3 with Python 3.6.

-- The C compiler identification is GNU 5.4.0 -- The CXX compiler identification is GNU 5.4.0 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Looking for pthread.h -- Looking for pthread.h - found -- Looking for pthread_create -- Looking for pthread_create - not found -- Looking for pthread_create in pthreads -- Looking for pthread_create in pthreads - not found -- Looking for pthread_create in pthread -- Looking for pthread_create in pthread - found -- Found Threads: TRUE
-- Found Protobuf: /home/luyang/anaconda3/lib/libprotobuf.so
-- Found OpenCV: /home/luyang/anaconda3 (found version "3.3.1") -- Configuring done -- Generating done -- Build files have been written to: /home/luyang/Documents/caffe2_cpp_tutorial-master/build downloading test image (2) ######################################################################### 100.0% ######################################################################### 100.0% downloading Squeezenet model (2) ######################################################################### 100.0%######################################################################### 100.0% ######################################################################### 100.0% downloading MNIST train data (2) ######################################################################### 100.0% ######################################################################### 100.0% E0318 22:22:00.325806 14251 init_intrinsics_check.cc:59] CPU feature avx is present on your machine, but the Caffe2 binary is not compiled with it. It means you may not get the full speed of your CPU. E0318 22:22:00.326098 14251 init_intrinsics_check.cc:59] CPU feature avx2 is present on your machine, but the Caffe2 binary is not compiled with it. It means you may not get the full speed of your CPU. E0318 22:22:00.326107 14251 init_intrinsics_check.cc:59] CPU feature fma is present on your machine, but the Caffe2 binary is not compiled with it. It means you may not get the full speed of your CPU. Aborted at 1521426120 (unix time) try "date -d @1521426120" if you are using GNU date PC: @ 0x404c72 caffe2::convert_dataset() SIGSEGV (@0x0) received by PID 14251 (TID 0x7f5de1a35800) from PID 0; stack trace: @ 0x7f5ddf6c64b0 (unknown) @ 0x404c72 caffe2::convert_dataset() @ 0x403bce main @ 0x7f5ddf6b1830 __libc_start_main @ 0x403c09 _start ./script/download_resource.sh: line 19: 14251 Segmentation fault (core dumped) make_mnist_db --image_file=res/train-images-idx3-ubyte --label_file=res/train-labels-idx1-ubyte --output_file=res/mnist-train-nchw-leveldb --channel_first --db leveldb make[1]: Entering directory '/home/luyang/Documents/caffe2_cpp_tutorial-master/build' make[2]: Entering directory '/home/luyang/Documents/caffe2_cpp_tutorial-master/build' make[3]: Entering directory '/home/luyang/Documents/caffe2_cpp_tutorial-master/build' Scanning dependencies of target caffe2_cpp make[3]: Leaving directory '/home/luyang/Documents/caffe2_cpp_tutorial-master/build' make[3]: Entering directory '/home/luyang/Documents/caffe2_cpp_tutorial-master/build' [ 1%] Building CXX object CMakeFiles/caffe2_cpp.dir/src/caffe2/util/net_serial.cc.o [ 3%] Building CXX object CMakeFiles/caffe2_cpp.dir/src/caffe2/util/net_gradient.cc.o [ 5%] Building CXX object CMakeFiles/caffe2_cpp.dir/src/caffe2/util/net.cc.o [ 6%] Building CXX object CMakeFiles/caffe2_cpp.dir/src/caffe2/util/net_operator.cc.o [ 8%] Building CXX object CMakeFiles/caffe2_cpp.dir/src/caffe2/util/model.pb.cc.o /home/luyang/Documents/caffe2_cpp_tutorial-master/src/caffe2/util/model.pb.cc: In static member function ‘static void caffe2::protobuf_model_2eproto::TableStruct::InitDefaultsImpl()’: /home/luyang/Documents/caffe2_cpp_tutorial-master/src/caffe2/util/model.pb.cc:144:13: error: ‘caffe2::protobuf_external_2eproto’ has not been declared ::caffe2::protobuf_external_2eproto::InitDefaults(); ^ /home/luyang/Documents/caffe2_cpp_tutorial-master/src/caffe2/util/model.pb.cc: In function ‘void caffe2::protobuf_model_2eproto::{anonymous}::AddDescriptorsImpl()’: /home/luyang/Documents/caffe2_cpp_tutorial-master/src/caffe2/util/model.pb.cc:186:13: error: ‘caffe2::protobuf_external_2eproto’ has not been declared ::caffe2::protobuf_external_2eproto::AddDescriptors(); ^ CMakeFiles/caffe2_cpp.dir/build.make:158: recipe for target 'CMakeFiles/caffe2_cpp.dir/src/caffe2/util/model.pb.cc.o' failed make[3]: [CMakeFiles/caffe2_cpp.dir/src/caffe2/util/model.pb.cc.o] Error 1 make[3]: Leaving directory '/home/luyang/Documents/caffe2_cpp_tutorial-master/build' CMakeFiles/Makefile2:332: recipe for target 'CMakeFiles/caffe2_cpp.dir/all' failed make[2]: [CMakeFiles/caffe2_cpp.dir/all] Error 2 make[2]: Leaving directory '/home/luyang/Documents/caffe2_cpp_tutorial-master/build' Makefile:83: recipe for target 'all' failed make[1]: [all] Error 2 make[1]: Leaving directory '/home/luyang/Documents/caffe2_cpp_tutorial-master/build' Makefile:4: recipe for target 'all' failed make: [all] Error 2

leovandriel commented 6 years ago

Hi, thanks for reporting. What version of protobuf do you have installed? use protoc --version

Crefeda commented 6 years ago

Hi, which version is required ? I have libprotoc 3.5.1 and I have a similar error. Thanks!