OpenPose 開源庫安裝


一、下載openpose
下載openpose

使用Git直接下載openpose

git clone https://github.com/CMU-Perceptual-Computing-Lab/openpose.git

或者去github下載 openpose master.zip

unzip openpose-master.zip,用unzip命令解壓,
mv openpose-master openpose, 然后重命名為openpose


二、下載模型文件

cd models
./getModels.sh
cd ..

三、Cmake編譯

cd build
cmake ../


修改buil/CMakeCache.txt的相關文件目錄:
BULID_CAFFE -> OFF
Caffe_LIBS -> 修改成本地安裝的目錄
Caffe_INCLUDE_DIRS _> caffe安裝文件的include目錄

# 之后就可以編譯了

make -j 8

四、測試安裝

./build/examples/openpose/openpose.bin --video examples/media/video.avi

 【注意】此處使用的caffe需要時openpose自帶的caffe編譯。否則運行自帶模型會報錯

- 首先把3rdparty/caffe/的文件 move到openpose同一級目錄,然后編譯caffe

- caffe編譯之后,就可以使用此caffe編譯OpenPose了

 

 參考資料:

 

[OpenPose環境搭建]( )

 OpenPose安裝使用初步介紹

 

雜七雜八-------------------------------------------------------------------------------------------

 

 

 

 

ErrOR

fatal error: hdf5.h: No such file or directory compilation terminated.

fatal error: hdf5.h: No such file or directory compilation terminated.

 

1.修改  Makefile.config  文件

添加/usr/include/hdf5/serial/  INCLUDE_DIRS

 

即原來的:

 

INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include

現在變成:

 

INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial/

 

2.修改  Makefile  文件

 Makefile  文件中,按住crtl+f  搜索:LIBRARIES +=

 

注意不是上面第1步的  Makefile.config!!!

 

 hdf5_hl hdf5修改為hdf5_serial_hl  hdf5_serial

 

即原來的:

 

LIBRARIES += glog gflags protobuf boost_system boost_filesystem m hdf5_hl hdf5

現在變成:

 

LIBRARIES += glog gflags protobuf boost_system boost_filesystem m hdf5_serial_hl hdf5_serial

————————————————

版權聲明:本文為CSDN博主「volcano_Lin」的原創文章,遵循 CC 4.0 BY-SA 版權協議,轉載請附上原文出處鏈接及本聲明。

原文鏈接:https://blog.csdn.net/qq_38451119/article/details/81383266

 

nvcc fatal : Unsupported gpu architecture 'compute_20'

 

 

https://blog.csdn.net/weixin_37983220/article/details/85341058

錯誤:

 

VCC src/caffe/layers/softmax_loss_layer.cu

nvcc fatal   : Unsupported gpu architecture 'compute_20'

Makefile:605: recipe for target '.build_release/cuda/src/caffe/layers/softmax_loss_layer.o' failed

make: *** [.build_release/cuda/src/caffe/layers/softmax_loss_layer.o] Error 1

 

解決方案:

 

在Makefile.config文件中根據自己CUDA的版本注釋不同的行。

 

# CUDA architecture setting: going with all of them.

# For CUDA < 6.0, comment the *_50 through *_61 lines for compatibility.

# For CUDA < 8.0, comment the *_60 and *_61 lines for compatibility.

# For CUDA >= 9.0, comment the *_20 and *_21 lines for compatibility.

CUDA_ARCH := #-gencode arch=compute_20,code=sm_20 \

                #-gencode arch=compute_20,code=sm_21

                -gencode arch=compute_30,code=sm_30 \

                -gencode arch=compute_35,code=sm_35 \

                -gencode arch=compute_50,code=sm_50 \

                -gencode arch=compute_52,code=sm_52 \

                -gencode arch=compute_60,code=sm_60 \

                -gencode arch=compute_61,code=sm_61 \

                -gencode arch=compute_61,code=compute_61

 

 

————————————————

版權聲明:本文為CSDN博主「青春如詩_」的原創文章,遵循 CC 4.0 BY-SA 版權協議,轉載請附上原文出處鏈接及本聲明。

原文鏈接:https://blog.csdn.net/weixin_37983220/article/details/85341058

 

ERROR: gflags’

 

注意看第三句的末尾namespace更改為了google,所以把原來函數前面的 " gflags:: " 改為 " google:: " 即可。

src/caffe/common.cpp: In function ‘void caffe::GlobalInit(int*, char***)’:

src/caffe/common.cpp:45:5: error: ‘::gflags’ has not been declared

   ::gflags::ParseCommandLineFlags(pargc, pargv, true);

     ^~~~~~

Makefile:591: recipe for target '.build_release/src/caffe/common.o' failed

make: *** [.build_release/src/caffe/common.o] Error 1

make: *** Waiting for unfinished jobs....

In file included from src/caffe/solvers/sgd_solver.cpp:5:0:

./include/caffe/util/hdf5.hpp:7:10: fatal error: hdf5.h: No such file or directory

 #include "hdf5.h"

          ^~~~~~~~

compilation terminated.

Makefile:591: recipe for target '.build_release/src/caffe/solvers/sgd_solver.o' failed

make: *** [.build_release/src/caffe/solvers/sgd_solver.o] Error 1

 

ERROR

https://github.com/BVLC/caffe/issues/4621

Not sure if the correct solution but seemingly works:
add the second line in the Makefile:

LIBRARIES += glog gflags protobuf boost_system boost_filesystem m hdf5_hl hdf5 \

        opencv_core opencv_highgui opencv_imgproc opencv_imgcodecs

 

ISSUE:

CXX/LD -o .build_release/examples/mnist/convert_mnist_data.bin

.build_release/lib/libcaffe.so: undefined reference to `cblas_sgemv'

.build_release/lib/libcaffe.so: undefined reference to `cblas_dgemm'

.build_release/lib/libcaffe.so: undefined reference to `cblas_sscal'

.build_release/lib/libcaffe.so: undefined reference to `cblas_dgemv'

.build_release/lib/libcaffe.so: undefined reference to `cblas_saxpy'

.build_release/lib/libcaffe.so: undefined reference to `cblas_ddot'

.build_release/lib/libcaffe.so: undefined reference to `cblas_dasum'

.build_release/lib/libcaffe.so: undefined reference to `cblas_sgemm'

.build_release/lib/libcaffe.so: undefined reference to `cblas_dscal'

.build_release/lib/libcaffe.so: undefined reference to `cblas_scopy'

.build_release/lib/libcaffe.so: undefined reference to `cblas_sasum'

.build_release/lib/libcaffe.so: undefined reference to `cblas_daxpy'

.build_release/lib/libcaffe.so: undefined reference to `cblas_dcopy'

.build_release/lib/libcaffe.so: undefined reference to `cblas_sdot'

collect2: error: ld returned 1 exit status

Makefile:636: recipe for target '.build_release/tools/extract_features.bin' failed

make: *** [.build_release/tools/extract_features.bin] Error 1

make: *** Waiting for unfinished jobs....

 

ERROR R_X86_64_32 against

 

Linking CXX shared library ../../lib/libcaffe-d.so

/usr/bin/ld: /usr/local/lib/libcblas.a(cblas_sgemv.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC

/usr/local/lib/libcblas.a: error adding symbols: Bad value

collect2: error: ld returned 1 exit status

make[2]: *** [lib/libcaffe-d.so.1.0.0-rc3] Error 1

make[1]: *** [src/caffe/CMakeFiles/caffe.dir/all] Error 2

 

————————————————

版權聲明:本文為CSDN博主「持久決心」的原創文章,遵循 CC 4.0 BY-SA 版權協議,轉載請附上原文出處鏈接及本聲明。

原文鏈接:https://blog.csdn.net/u013832707/article/details/52748944

解決方法:

編輯build文件夾下的CMakeCache.txt,將

 

//Path to a library.

Atlas_CBLAS_LIBRARY:FILEPATH=<path to libcblas.a>

 

改為:

//Path to a library.

Atlas_CBLAS_LIBRARY:FILEPATH=/usr/lib/libcblas.so //<path to libcblas.so in my machine>

 

————————————————

版權聲明:本文為CSDN博主「持久決心」的原創文章,遵循 CC 4.0 BY-SA 版權協議,轉載請附上原文出處鏈接及本聲明。

原文鏈接:https://blog.csdn.net/u013832707/article/details/52748944

 

 

https://github.com/BVLC/caffe/issues/4621

I think the reason is you use make to compile, which makes caffe's python port only find libraries in this catalog. Maybe you use cmake to compile and it could work.
make clean
cd caffe-master
mkdir build
cd build
cmake ..
make all -j8
I hope I could help you!

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM