ImportError:dlopen(...)库未打开

时间:2015-07-13 21:33:18

标签: python macos neural-network anaconda caffe

我正在尝试在运行OSx 10.9.5的mac上运行Google Research's DeepDream code 我必须安装一些依赖项。我使用的是Anaconda的python发行版,我确保我拥有所需的所有软件包。

最困难的事情是安装Caffe。我用fink安装了ATLAS。然后我编译了caffe和pycaffe。当我跑去跑去'所有测试都通过了我还跑了“分发”#。

当我运行the notebook released from Google时,出现以下错误:

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-453033db464f> in <module>()
     11 
     12 
---> 13 import caffe
     14 
     15 

/Users/Andrea/caffe/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

/Users/Andrea/caffe/python/caffe/pycaffe.py in <module>()
     11 import numpy as np
     12 
---> 13 from ._caffe import Net, SGDSolver
     14 import caffe.io
     15 

ImportError: dlopen(/Users/Andrea/caffe/python/caffe/_caffe.so, 2): Library not loaded: @rpath/libcudart.7.0.dylib
  Referenced from: /Users/Andrea/caffe/python/caffe/_caffe.so
  Reason: image not found

我该怎么做才能解决这个问题?

here is the screendump requested in a comment

1 个答案:

答案 0 :(得分:1)

libcudart.7.0.dylib是一个与GPU相关的库。

您运行的机器是否有GPU?如果没有,则需要在Makefile.config中为caffe。

指定CPU模式

如果你有GPU,那么请看看这里。 https://github.com/BVLC/caffe/issues/779