【问题标题】:ImportError: dlopen(...) library not openImportError: dlopen(...) 库未打开
【发布时间】:2015-07-13 21:33:17
【问题描述】:

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

最难的是安装 Caffe。我使用 fink 安装了 ATLAS。然后我编译了caffe和pycaffe。当我运行“make runtest”时,所有测试都通过了。我还运行了“make distribution”。

当我运行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

我能做些什么来解决这个问题?


【问题讨论】:

    标签: python macos neural-network anaconda caffe


    【解决方案1】:

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

    您运行的机器有 GPU 吗?如果没有,则需要在 Makefile.config 中为 caffe 指定 CPU 模式。

    如果您有 GPU,请查看此处。 https://github.com/BVLC/caffe/issues/779

    【讨论】:

    • 我删除了包含 caffe 的文件夹,并在 CPU 模式开启的情况下重新编译了整个文件。现在它给了我这个错误: ImportError: dlopen(/Users/Andrea/caffe-master/python/caffe/_caffe.so, 2): Library not loaded: libhdf5_hl.10.dylib
    • 当这种情况发生时你能分享更多吗?您在屏幕上看到的内容的屏幕转储会很有用。当你全部制作或制作 pycaffe 时会发生这种情况吗?
    • 当我运行 dream.ipynb 中的第一个代码块时,就会发生这种情况,这里下载 github.com/google/deepdream,如问题正文中所述。
    • 即我make clean后make all、make test、make runtest、makepycaffe、makedistribute到caffe所在的文件夹。
    • python/caffe/_caffe.so 错误通常是由于 caffe 不在 PYTHONPATH 中。就像我说的,当我看不到你到底做了什么来这里时,很难提供更多帮助。抱歉,帮不上忙
    猜你喜欢
    • 1970-01-01
    • 2016-06-29
    • 1970-01-01
    • 1970-01-01
    • 2017-04-25
    • 1970-01-01
    • 2011-09-16
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多