我无法将 caffe 导入(anaconda-)python。我正在关注关于“非图像 HDF5 数据的逻辑回归”的笔记本示例。当我执行该行时
import caffe
我收到以下错误:
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-17-3524921938b5> in <module>()
8 sys.path.insert(0, caffe_root + 'python')
9
---> 10 import caffe
11
/home/myName/libs/caffe/caffe-master-anaconda-python/python/caffe/__init__.py in <module>()
----> 1 from .pycaffe import Net, SGDSolver
2 from ._caffe import set_mode_cpu, set_mode_gpu, set_device, Layer, get_solver
3 from .proto.caffe_pb2 import TRAIN, TEST
4 from .classifier import Classifier
5 from .detector import Detector
/home/myName/libs/caffe/caffe-master-anaconda-python/python/caffe/pycaffe.py in <module>()
11 import numpy as np
12
---> 13 from ._caffe import Net, SGDSolver
14 import caffe.io
15
ImportError: libjpeg.so.62: cannot open shared object file: No such file or directory
该库libjpeg.so.62
明确安装在/usr/lib/i386-linux-gnu/libjpeg.so.62
. 我不知道这里出了什么问题,也不知道如何告诉 anacondapython 在哪里寻找libjpeg.so.62
.
我已经尝试过了,sudo apt-get install libjpeg62:i386
但 apt-get 说"libjpeg62:i386 is already the newest version. libjpeg62:i386 set to manually installed."
我在修改“Makefile.config”时编译了 caffe,使其指向 ananconda python 路径。我还导出了我的 anaconda 目录的 PYTHONPATH 和 PATH:
export PATH="/home/myName/libs/anaconda/bin:$PATH"
export PYTHONPATH="/home/myName/libs/caffe/caffe-master-anaconda-python/python:$PYTHONPATH"