我正在努力运行这个演示 https://github.com/ZheC/Realtime_Multi-Person_Pose_Estimation
我正在运行 ubuntu 14.04
我已经安装了 Anaconda,在安装了很多很多依赖项之后,又弹出了一个依赖项。它还需要python caffe
所以我用这个命令安装它:
(我也试过 Pip install caffe
但如果失败了)
Conda install caffe
但是当我尝试运行它时,我得到:
$python
>>> import caffe
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/gtkratosman-lap/anaconda2/lib/python2.7/site-packages/caffe/__init__.py", line 1, in <module>
from .pycaffe import Net, SGDSolver, NesterovSolver, AdaGradSolver, RMSPropSolver, AdaDeltaSolver, AdamSolver, NCCL, Timer
File "/home/gtkratosman-lap/anaconda2/lib/python2.7/site-packages/caffe/pycaffe.py", line 13, in <module>
from ._caffe import Net, SGDSolver, NesterovSolver, AdaGradSolver, \
ImportError: libprotobuf.so.12: cannot open shared object file: No such file or directory
最佳答案
我已经能够在我自己的 Anaconda 环境中验证此行为,在 Python v2.7.14 虚拟环境中运行 conda v4.3.27,安装 caffe
v1.0.0rc5。
进一步研究该问题后,它似乎与以下 Unresolved Anaconda 问题有关:caffe needs to pin protobuf requirement to version #6733
如问题中所述:
The
caffe
andcaffe-gpu
package indefaults
has a requirement on protobuf without any version dependencies. Unfortunately, the caffe packages links to libprotobuf.so.12 which is provided by the protbuf version 3.2.0
因此,我发现我能够通过首先手动安装 protobuf v3.2.0,在我的 Anaconda 虚拟环境中运行的 Python 中成功import caffe
,如下所示:conda install protobuf ==3.2.0
关于python - 使用 anaconda2 安装 python caffe (pycaffe),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47460860/