GithubHelp home page GithubHelp logo

Comments (11)

guker avatar guker commented on May 2, 2024 3

it works.
os system: centos7 , default( protobuf 2.6.1, gcc 4.8.5)

  1. git clone https://github.com/CMU-Perceptual-Computing-Lab/openpose
  2. cd 3rdparty
  3. git clone https://github.com/CMU-Perceptual-Computing-Lab/caffe.git
  4. cd caffe
  5. cp Makefile.config.Ubuntu14_cuda8.example Makefile.config
  6. modify blas choice by changing BLAS := open
  7. make all # in caffe dir
  8. protoc src/caffe/proto/caffe.proto --cpp_out=.
  9. mkdir include/caffe/proto
  10. mv src/caffe/proto/caffe.pb.h include/caffe/proto
  11. cmake -DCaffe_INCLUDE_DIRS=/xxx/3rdparty/caffe/include/ -DCaffe_LIBS=/xxx/3rdparty/caffe/build/lib/libcaffe.so -DBUILD_CAFFE=OFF .. # here /xxx is absolute path of 3rdparty
  12. make -j[cpu count]

please keep protobuf version 2.6.1
if compile error, please update gcc version(such as gcc 7.3.1)
update gcc method:

  1. yum -y install centos-release-scl
  2. yum -y install devtoolset-7-gcc devtoolset-7-gcc-c++ devtoolset-7-binutils
  3. scl enable devtoolset-7 bash

from openpose.

ankit204 avatar ankit204 commented on May 2, 2024 2

Just writing down the steps I ended up running to make things work on centOS.
Create and move to build directory.
Use this command to point cmake to correct libs and include dirs for an existing caffe build:
$ cmake -DCaffe_INCLUDE_DIRS=/caffe-rc3/include/ -DCaffe_LIBS=/caffe-rc3/build/lib/libcaffe.so -DBUILD_CAFFE=OFF ..
It gave the following error issuing make:

Linking CXX executable openpose.bin
/bin/ld: /usr/local/lib/libgflags.a(gflags.cc.o): undefined reference to symbol 'pthread_rwlock_wrlock@@GLIBC_2.2.5'
/bin/ld: note: 'pthread_rwlock_wrlock@@GLIBC_2.2.5' is defined in DSO /lib64/libpthread.so.0 so try adding it to the linker command line
/lib64/libpthread.so.0: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status
make[2]: *** [examples/openpose/openpose.bin] Error 1
make[1]: *** [examples/openpose/CMakeFiles/openpose.bin.dir/all] Error 2

To resolve this, I added a flag to CMakeLists.txt after which the unix sub-case looks like this:

elseif (UNIX AND NOT APPLE)
  # Turn on C++11
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -lpthread")
  add_definitions(-std=c++11)
  set(CMAKE_CXX_FLAGS_RELEASE "-O3")

After the change, issuing cmake and make should build successfully.
When running the demo, make sure to use --display 0 if you face X11 issues. Full command:
$ ./build/examples/openpose/openpose.bin --net_resolution "64x48" --image_dir examples/media/ --display 0 --write_json out

from openpose.

gineshidalgo99 avatar gineshidalgo99 commented on May 2, 2024

I am sorry, but we do not have any Centos machine to try it.

The OpenPose code uses c++11 and the same dependencies than Caffe. So if you are able to compile Caffe (with CUDA and cuDNN) of you own on Centos, you should be able to install OpenPose too.

Please, if you are able to install it, a few lines with the basic steps would be highly appreciated for other Centos users.

from openpose.

liaowang0125 avatar liaowang0125 commented on May 2, 2024

Compiled OpenPose successfully.

Just as you say,modify the CAFFE_DIR ,and have an compiled caffe is enough.

When I first comment,I met the google::protobuf undefined reference problem,I solved it and can install OpenPose.

from openpose.

ZheC avatar ZheC commented on May 2, 2024

Great, thanks for letting us know.

from openpose.

saxenarohan97 avatar saxenarohan97 commented on May 2, 2024

@liaowang0125 How did you modify the CAFFE_DIR, can you please elaborate? Maybe post your makefile?

from openpose.

liaowang0125 avatar liaowang0125 commented on May 2, 2024

modify it to the path to your compiled caffe,like: path/caffe @saxenarohan97

from openpose.

gineshidalgo99 avatar gineshidalgo99 commented on May 2, 2024

@ankit204
Thanks for the feed-back. I've just pushed a fix to include pthread as you did. Could you try the latest OpenPose and let me know if it works by default? Thanks!

(PS: Instead of -lpthread, I did it in the supposedly right CMake way with find_package, it works in Ubuntu, but I could not test it on CentOS as I don't have it)

from openpose.

boris-lb avatar boris-lb commented on May 2, 2024

@liaowang0125 ,can you tell me how do you solve the google::protobuf undefined reference problem?this is my error msg:
[ 91%] Linking CXX executable cpp_classification/classification
[ 93%] Linking CXX executable upgrade_net_proto_text
[ 93%] Linking CXX executable upgrade_net_proto_binary
[ 93%] Linking CXX executable caffe
[ 94%] Linking CXX executable upgrade_solver_proto_text
../lib/libcaffe.so.1.0.0:对‘google::protobuf::internal::AssignDescriptors(std::string const&, google::protobuf::internal::MigrationSchema const*, google::protobuf::Message const* const*, unsigned int const*, google::protobuf::Metadata*, google::protobuf::EnumDescriptor const**, google::protobuf::ServiceDescriptor const**)’未定义的引用
../lib/libcaffe.so.1.0.0:对‘google::protobuf::io::CodedInputStream::SetTotalBytesLimit(int)’未定义的引用
../lib/libcaffe.so.1.0.0:对‘google::protobuf::internal::InitSCCImpl(google::protobuf::internal::SCCInfoBase*)’未定义的引用
../lib/libcaffe.so.1.0.0:对‘google::protobuf::internal::WireFormatLite::Int64Size(google::protobuf::RepeatedField const&)’未定义的引用
collect2: 错误:ld 返回 1
../lib/libcaffe.so.1.0.0:对‘google::protobuf::internal::AssignDescriptors(std::string const&, google::protobuf::internal::MigrationSchema const*, google::protobuf::Message const* const*, unsigned int const*, google::protobuf::Metadata*, google::protobuf::EnumDescriptor const**, google::protobuf::ServiceDescriptor const**)’未定义的引用
../lib/libcaffe.so.1.0.0:对‘google::protobuf::io::CodedInputStream::SetTotalBytesLimit(int)’未定义的引用
../lib/libcaffe.so.1.0.0:对‘google::protobuf::internal::InitSCCImpl(google::protobuf::internal::SCCInfoBase*)’未定义的引用
../lib/libcaffe.so.1.0.0:对‘google::protobuf::internal::WireFormatLite::Int64Size(google::protobuf::RepeatedField const&)’未定义的引用
collect2: 错误:ld 返回 1
make[5]: *** [tools/convert_imageset] 错误 1
make[4]: *** [tools/CMakeFiles/convert_imageset.dir/all] 错误 2
make[4]: *** 正在等待未完成的任务....
make[5]: *** [examples/siamese/convert_mnist_siamese_data] 错误 1
make[4]: *** [examples/CMakeFiles/convert_mnist_siamese_data.dir/all] 错误 2
../lib/libcaffe.so.1.0.0:对‘google::protobuf::internal::AssignDescriptors(std::string const&, google::protobuf::internal::MigrationSchema const*, google::protobuf::Message const* const*, unsigned int const*, google::protobuf::Metadata*, google::protobuf::EnumDescriptor const**, google::protobuf::ServiceDescriptor const**)’未定义的引用
../lib/libcaffe.so.1.0.0:对‘google::protobuf::io::CodedInputStream::SetTotalBytesLimit(int)’未定义的引用
../lib/libcaffe.so.1.0.0:对‘google::protobuf::internal::InitSCCImpl(google::protobuf::internal::SCCInfoBase*)’未定义的引用
../lib/libcaffe.so.1.0.0:对‘google::protobuf::internal::WireFormatLite::Int64Size(google::protobuf::RepeatedField const&)’未定义的引用
../lib/libcaffe.so.1.0.0:对‘google::protobuf::internal::AssignDescriptors(std::string const&, google::collect2: 错误:ld 返回 1
protobuf::internal::MigrationSchema const*, google::protobuf::Message const* const*, unsigned int const*, google::protobuf::Metadata*, google::protobuf::EnumDescriptor const**, google::protobuf::ServiceDescriptor const**)’未定义的引用
../lib/libcaffe.so.1.0.0:对‘google::protobuf::io::CodedInputStream::SetTotalBytesLimit(int)’未定义的引用
../lib/libcaffe.so.1.0.0:对‘google::protobuf::internal::InitSCCImpl(google::protobuf::internal::SCCInfoBase*)’未定义的引用
../lib/libcaffe.so.1.0.0:对‘google::protobuf::internal::WireFormatLite::Int64Size(google::protobuf::RepeatedField const&)’未定义的引用
collect2: 错误:ld 返回 1
make[5]: *** [examples/cifar10/convert_cifar_data] 错误 1
make[5]: *** [examples/mnist/convert_mnist_data] 错误 1
make[4]: *** [examples/CMakeFiles/convert_cifar_data.dir/all] 错误 2
make[4]: *** [examples/CMakeFiles/convert_mnist_data.dir/all] 错误 2

from openpose.

JeBo89 avatar JeBo89 commented on May 2, 2024

Just writing down the steps I ended up running to make things work on centOS.
Create and move to build directory.
Use this command to point cmake to correct libs and include dirs for an existing caffe build:
$ cmake -DCaffe_INCLUDE_DIRS=/caffe-rc3/include/ -DCaffe_LIBS=/caffe-rc3/build/lib/libcaffe.so -DBUILD_CAFFE=OFF ..
It gave the following error issuing make:

Linking CXX executable openpose.bin
/bin/ld: /usr/local/lib/libgflags.a(gflags.cc.o): undefined reference to symbol 'pthread_rwlock_wrlock@@GLIBC_2.2.5'
/bin/ld: note: 'pthread_rwlock_wrlock@@GLIBC_2.2.5' is defined in DSO /lib64/libpthread.so.0 so try adding it to the linker command line
/lib64/libpthread.so.0: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status
make[2]: *** [examples/openpose/openpose.bin] Error 1
make[1]: *** [examples/openpose/CMakeFiles/openpose.bin.dir/all] Error 2

To resolve this, I added a flag to CMakeLists.txt after which the unix sub-case looks like this:

elseif (UNIX AND NOT APPLE)
  # Turn on C++11
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -lpthread")
  add_definitions(-std=c++11)
  set(CMAKE_CXX_FLAGS_RELEASE "-O3")

After the change, issuing cmake and make should build successfully.
When running the demo, make sure to use --display 0 if you face X11 issues. Full command:
$ ./build/examples/openpose/openpose.bin --net_resolution "64x48" --image_dir examples/media/ --display 0 --write_json out

Is this solution still applicable today?

from openpose.

MLsmaller avatar MLsmaller commented on May 2, 2024

it works. os system: centos7 , default( protobuf 2.6.1, gcc 4.8.5)

  1. git clone https://github.com/CMU-Perceptual-Computing-Lab/openpose
  2. cd 3rdparty
  3. git clone https://github.com/CMU-Perceptual-Computing-Lab/caffe.git
  4. cd caffe
  5. cp Makefile.config.Ubuntu14_cuda8.example Makefile.config
  6. modify blas choice by changing BLAS := open
  7. make all # in caffe dir
  8. protoc src/caffe/proto/caffe.proto --cpp_out=.
  9. mkdir include/caffe/proto
  10. mv src/caffe/proto/caffe.pb.h include/caffe/proto
  11. cmake -DCaffe_INCLUDE_DIRS=/xxx/3rdparty/caffe/include/ -DCaffe_LIBS=/xxx/3rdparty/caffe/build/lib/libcaffe.so -DBUILD_CAFFE=OFF .. # here /xxx is absolute path of 3rdparty
  12. make -j[cpu count]

please keep protobuf version 2.6.1 if compile error, please update gcc version(such as gcc 7.3.1) update gcc method:

  1. yum -y install centos-release-scl
  2. yum -y install devtoolset-7-gcc devtoolset-7-gcc-c++ devtoolset-7-binutils
  3. scl enable devtoolset-7 bash

Thank you very much. I successfully installed Openpose under centos according to your steps, and you saved me.

from openpose.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.