yjxiong / temporal-segment-networks

Code & Models for Temporal Segment Networks (TSN) in ECCV 2016
BSD 2-Clause "Simplified" License
1.54k stars 477 forks source link

build error #172

Closed babiking closed 6 years ago

babiking commented 6 years ago

caffe-action building failed on my PC (Ubuntu16.04, cuda-8.0, cudnn-7), the error log is as follows:

../lib/libcaffe.so: undefined reference to google::base::CheckOpMessageBuilder::NewString()' ../lib/libcaffe.so: undefined reference togoogle::protobuf::internal::NameOfEnum(google::protobuf::EnumDescriptor const*, int)' collect2: error: ld returned 1 exit status tools/CMakeFiles/upgrade_net_proto_text.dir/build.make:136: recipe for target 'tools/upgrade_net_proto_text' failed make[2]: [tools/upgrade_net_proto_text] Error 1 CMakeFiles/Makefile2:629: recipe for target 'tools/CMakeFiles/upgrade_net_proto_text.dir/all' failed make[1]: [tools/CMakeFiles/upgrade_net_proto_text.dir/all] Error 2 ../lib/libcaffe.so: undefined reference to google::base::CheckOpMessageBuilder::NewString()' ../lib/libcaffe.so: undefined reference togoogle::protobuf::internal::NameOfEnum(google::protobuf::EnumDescriptor const*, int)' collect2: error: ld returned 1 exit status examples/CMakeFiles/convert_cifar_data.dir/build.make:136: recipe for target 'examples/cifar10/convert_cifar_data' failed make[2]: [examples/cifar10/convert_cifar_data] Error 1 CMakeFiles/Makefile2:957: recipe for target 'examples/CMakeFiles/convert_cifar_data.dir/all' failed make[1]: [examples/CMakeFiles/convert_cifar_data.dir/all] Error 2 [ 98%] Built target test_net ../lib/libcaffe.so: undefined reference to google::base::CheckOpMessageBuilder::NewString()' ../lib/libcaffe.so: undefined reference togoogle::protobuf::internal::NameOfEnum(google::protobuf::EnumDescriptor const*, int)' collect2: error: ld returned 1 exit status tools/CMakeFiles/compute_image_mean.dir/build.make:136: recipe for target 'tools/compute_image_mean' failed make[2]: [tools/compute_image_mean] Error 1 CMakeFiles/Makefile2:705: recipe for target 'tools/CMakeFiles/compute_image_mean.dir/all' failed make[1]: [tools/CMakeFiles/compute_image_mean.dir/all] Error 2 [100%] Linking CXX executable upgrade_net_proto_binary ../lib/libcaffe.so: undefined reference to google::base::CheckOpMessageBuilder::NewString()' ../lib/libcaffe.so: undefined reference togoogle::protobuf::internal::NameOfEnum(google::protobuf::EnumDescriptor const*, int)' collect2: error: ld returned 1 exit status tools/CMakeFiles/upgrade_net_proto_binary.dir/build.make:136: recipe for target 'tools/upgrade_net_proto_binary' failed make[2]: [tools/upgrade_net_proto_binary] Error 1 CMakeFiles/Makefile2:781: recipe for target 'tools/CMakeFiles/upgrade_net_proto_binary.dir/all' failed make[1]: [tools/CMakeFiles/upgrade_net_proto_binary.dir/all] Error 2 [100%] Linking CXX executable caffe [100%] Linking CXX executable cpp_classification/classification ../lib/libcaffe.so: undefined reference to google::base::CheckOpMessageBuilder::NewString()' ../lib/libcaffe.so: undefined reference togoogle::protobuf::internal::NameOfEnum(google::protobuf::EnumDescriptor const*, int)' collect2: error: ld returned 1 exit status tools/CMakeFiles/caffe.bin.dir/build.make:136: recipe for target 'tools/caffe' failed make[2]: [tools/caffe] Error 1 CMakeFiles/Makefile2:553: recipe for target 'tools/CMakeFiles/caffe.bin.dir/all' failed make[1]: [tools/CMakeFiles/caffe.bin.dir/all] Error 2 ../lib/libcaffe.so: undefined reference to google::base::CheckOpMessageBuilder::NewString()' ../lib/libcaffe.so: undefined reference togoogle::protobuf::internal::NameOfEnum(google::protobuf::EnumDescriptor const*, int)' collect2: error: ld returned 1 exit status examples/CMakeFiles/classification.dir/build.make:136: recipe for target 'examples/cpp_classification/classification' failed make[2]: [examples/cpp_classification/classification] Error 1 CMakeFiles/Makefile2:881: recipe for target 'examples/CMakeFiles/classification.dir/all' failed make[1]: [examples/CMakeFiles/classification.dir/all] Error 2 [100%] Linking CXX executable extract_features ../lib/libcaffe.so: undefined reference to google::base::CheckOpMessageBuilder::NewString()' ../lib/libcaffe.so: undefined reference togoogle::protobuf::internal::NameOfEnum(google::protobuf::EnumDescriptor const*, int)' collect2: error: ld returned 1 exit status tools/CMakeFiles/extract_features.dir/build.make:136: recipe for target 'tools/extract_features' failed make[2]: [tools/extract_features] Error 1 CMakeFiles/Makefile2:667: recipe for target 'tools/CMakeFiles/extract_features.dir/all' failed make[1]: [tools/CMakeFiles/extract_features.dir/all] Error 2 [100%] Linking CXX shared library ../lib/_caffe.so Creating symlink /home/brojackfeely/Downloads/temporal-segment-networks-master/lib/caffe-action/python/caffe/_caffe.so -> /home/brojackfeely/Downloads/temporal-segment-networks-master/lib/caffe-action/build/lib/_caffe.so [100%] Built target pycaffe Makefile:127: recipe for target 'all' failed make: *** [all] Error 2

it seems to be caused by the conflict between opencv and cuda-8.0... If I use the system-default opencv (installed by 'sudo apt-get install python-opencv'), I can successfully pass the caffe-action build. But in test phase, I will get another error: Error parsing text-format caffe.NetParameter: 19:12: Message type "caffe.LayerParameter" has no field named "bn_param". Do you have any suggested solution?

p.s. Thanks for your outstanding contribution in video recognition field!

babiking commented 6 years ago

problem resolved by building static library i.e. libprotobuf.a from the source code of protobuf and change the cmake configurations when building opencv and caffe.

babiking commented 6 years ago

besides, caffe.LayerParameter has no field named "bn_param" is caused by that I installed another version of caffe i.e. caffe-latest-master, and the default PYTHONPATH is set as 'caffe-latest-master/python'. it can be solved by python package-management.

yjxiong commented 6 years ago

Thanks for posting your solution.