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