FaceBook DensePose安装记录

DensPose介绍

DensePose即Dense Human Pose Estimation In The Wild

主页

Github代码

FaceBook DensePose安装记录_第1张图片

安装

(1)安装参考

  • a.《[MineSweeping] The Long Struggle of DensePose Installation》
  • b.初版《densepose吐血安装之路》+升级版《ubuntu16安装densepose完整版--深度解决protobuf问题》
  • c.《densepose安装过程记录》
  • d.《Installing DensePose》

(2)奇葩问题及解决方法

a1.问题

OSError: /home/mychoer/densepose/build/libcaffe2_detectron_custom_ops_gpu.so: undefined symbol: _ZN6caffe219CPUOperatorRegistryB5cxx11Ev

b1.解决方案

升级版《ubuntu16安装densepose完整版--深度解决protobuf问题,将gcc版本从降到4.9.x即可,三行命令解决:


sudo apt-get install gcc-4.9 g++-4.9

sudo cp /usr/bin/gcc-4.9 /usr/bin/gcc

sudo cp /usr/bin/g++-4.9 /usr/bin/g++

 

a2.问题

Traceback (most recent call last):
  File "tools/infer_simple.py", line 140, in 
    main(args)
  File "tools/infer_simple.py", line 91, in main
    model = infer_engine.initialize_model_from_cfg(args.weights)
  File "/home/dm/chenriquan/DensePose/detectron/core/test_engine.py", line 336, in initialize_model_from_cfg
    model, weights_file, gpu_id=gpu_id,
  File "/home/dm/chenriquan/DensePose/detectron/utils/net.py", line 56, in initialize_gpu_from_weights_file
    saved_cfg = load_cfg(src_blobs['cfg'])
  File "/home/dm/chenriquan/DensePose/detectron/core/config.py", line 1167, in load_cfg
    return yaml.load(cfg_to_load)
  File "/home/dm/anaconda3/envs/densepose/lib/python2.7/site-packages/yaml/__init__.py", line 114, in load
    return loader.get_single_data()
  File "/home/dm/anaconda3/envs/densepose/lib/python2.7/site-packages/yaml/constructor.py", line 45, in get_single_data
    return self.construct_document(node)
  File "/home/dm/anaconda3/envs/densepose/lib/python2.7/site-packages/yaml/constructor.py", line 49, in construct_document
    data = self.construct_object(node)
  File "/home/dm/anaconda3/envs/densepose/lib/python2.7/site-packages/yaml/constructor.py", line 96, in construct_object
    data = constructor(self, tag_suffix, node)
  File "/home/dm/anaconda3/envs/densepose/lib/python2.7/site-packages/yaml/constructor.py", line 628, in construct_python_object_new
    return self.construct_python_object_apply(suffix, node, newobj=True)
  File "/home/dm/anaconda3/envs/densepose/lib/python2.7/site-packages/yaml/constructor.py", line 611, in construct_python_object_apply
    value = self.construct_mapping(node, deep=True)
  File "/home/dm/anaconda3/envs/densepose/lib/python2.7/site-packages/yaml/constructor.py", line 214, in construct_mapping
    return BaseConstructor.construct_mapping(self, node, deep=deep)
  File "/home/dm/anaconda3/envs/densepose/lib/python2.7/site-packages/yaml/constructor.py", line 139, in construct_mapping
    value = self.construct_object(value_node, deep=deep)
  File "/home/dm/anaconda3/envs/densepose/lib/python2.7/site-packages/yaml/constructor.py", line 101, in construct_object
    for dummy in generator:
  File "/home/dm/anaconda3/envs/densepose/lib/python2.7/site-packages/yaml/constructor.py", line 404, in construct_yaml_map
    value = self.construct_mapping(node)
  File "/home/dm/anaconda3/envs/densepose/lib/python2.7/site-packages/yaml/constructor.py", line 214, in construct_mapping
    return BaseConstructor.construct_mapping(self, node, deep=deep)
  File "/home/dm/anaconda3/envs/densepose/lib/python2.7/site-packages/yaml/constructor.py", line 139, in construct_mapping
    value = self.construct_object(value_node, deep=deep)
  File "/home/dm/anaconda3/envs/densepose/lib/python2.7/site-packages/yaml/constructor.py", line 96, in construct_object
    data = constructor(self, tag_suffix, node)
  File "/home/dm/anaconda3/envs/densepose/lib/python2.7/site-packages/yaml/constructor.py", line 617, in construct_python_object_apply
    instance = self.make_python_instance(suffix, node, args, kwds, newobj)
  File "/home/dm/anaconda3/envs/densepose/lib/python2.7/site-packages/yaml/constructor.py", line 558, in make_python_instance
    node.start_mark)
yaml.constructor.ConstructorError: while constructing a Python instance
expected a class, but found 
  in "", line 3, column 20:
      BBOX_XFORM_CLIP: !!python/object/apply:numpy.core ...

 

b2.解决方案

首先要排除pyyaml版本过高的原因,将python的pyyaml包降到3.12版本:

pip install pyyaml==3.12

大部分时候这个问题可以解决了,但是偶尔也会发现这样子無用!!!怎么办?

方法:从错误提示中找到症结所在,即detectron/core/config.py中的load_cfg(cfg_to_load)函数对pkl文件加载时出错,

借鉴《Latest pyyaml expecting class but getting function》,将函数最后一句:

return yaml.load(cfg_to_load)

改成:

yaml_load=lambda x: yaml.load(x, Loader=yaml.Loader)
return yaml_load(cfg_to_load)

 

 

a3.问题

基本参考以上文献,大多数问题都可以解决,但是我却在安装过程中遇到一个特别的问题:

FaceBook DensePose安装记录_第2张图片

 

即:

make[2]正在进入目录/medta/pct/NewDtsk4/DavtdChow/DensePose一master/build'
make[3]:正在进入目录/media/pct/NewDtsk4/DavtdChow/DensePose一master/build'
make[3]:正在离开目录/media/pct/NewDtsk4/DavtdChow/DensePose-master/build'
make[3]:正在进入目录/media/pct/NewDtsk4/DavtdChow/DensePose-master/build'
make[3]:正在进人目录/media/pct/NewDtsk4/DavtdChow/DensePose-master/build'
[12%] Linking CXX shared library ltbcaffe2_ detection_ custom_ops.so
make[3]:正在离开目录/media/pct/NewDtsk4/DavtdChow/DensePose-master/build'
make(3):正在进入目录/medta/pct/NewDtsk4/DavtdChow/DensePose-master/build'
[25%] Linking CXX shared library ltbcaffe2_ detectron_ custom_ops_gpu.so
/usr/btn/ld: /media/pct/NewDisk2/anaconda3/envs/caffe2/lib/libprotobuf.a(common.o):未识别的重定向(ex2a).位于'.text'区
/usr/bin/ld:最后的链结失败:错误的值
collect2: error: ld returned 1 exit status

b3.解决方案

参考:《Unable to compile: unrecognized relocation

一条命令解决:conda install binutils=2.26

 

你可能感兴趣的:(python)