ImportError: dlopen(…) library not open

落花浮王杯 提交于 2019-12-12 00:18:06

问题


I am trying to run Google Research's DeepDream code on a mac running OSx 10.9.5.
There are a few dependencies that I had to install. I am using the Anaconda distribution of python and I made sure that I have all the packages required.

The hardest thing was to install Caffe. I have ATLAS installed using fink. Then I have compiled caffe and pycaffe. When I ran 'make runtest' all tests passed. I also ran 'make distribute'.

When I run the notebook released from Google, I get the following error:

---------------------------------------------------------------------------
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

What can I do to fix this?



回答1:


libcudart.7.0.dylib is a GPU related library.

Does the machine you're running on have a GPU? If not, then you need to specify CPU mode in Makefile.config for caffe.

If you do have a GPU, then please take a look here. https://github.com/BVLC/caffe/issues/779



来源:https://stackoverflow.com/questions/31393897/importerror-dlopen-library-not-open

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!