If you don’t want to remove all packets, you can at first try removing only those, which are required by caffe: #to run caffe we need to export path to the built caffe:Įxport PYTHONPATH=/Users/kupa/Desktop/caffe-master/python/:$PYTHONPATH Number after j is the number of the CPUs available, in my case it's 8 #using -j8 key to enable parallel building. #we have to export this to make sure we include all the cuda and anaconda resourcesĮxport DYLD_FALLBACK_LIBRARY_PATH=/usr/local/cuda/lib:$HOME/anaconda/lib:/usr/local/lib:/usr/lib:$DYLD_FALLBACK_LIBRARY_PATHĮxport CPLUS_INCLUDE_PATH=$HOME/anaconda/include/python2.7/: LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/libĪfter editing nfig you should be able to install Caffe:įor x in snappy leveldb gflags glog szip hdf5 lmdb homebrew/science/opencv do brew uninstall $x brew install -fresh -vd $x doneīrew uninstall -force protobuf brew install -with-python -fresh -vd protobufīrew uninstall boost boost-python brew install -fresh -vd boost boost-python INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include # Whatever else you find you need goes here. # We need to be able to find libpythonX.X.so or. $(ANACONDA_HOME)/lib/python2.7/site-packages/numpy/core/include \ PYTHON_INCLUDE := $(ANACONDA_HOME)/include \ # Verify anaconda location, sometimes it’s in root. # Anaconda Python distribution is quite popular. usr/lib/python2.7/dist-packages/numpy/core/include PYTHON_INCLUDE := /usr/include/python2.7 \ # We need to be able to find Python.h and numpy/arrayobject.h. # NOTE: this is required only if you will compile the python interface. # MATLAB_DIR := /Applications/MATLAB_R2012b.app # MATLAB directory should contain the mex binary in /bin. # This is required only if you will compile the matlab interface. #BLAS_LIB := $(shell brew –prefix openblas)/libīLAS_INCLUDE := /usr/local/Cellar/openblas/0.2.14_1/includeīLAS_LIB := /usr/local/Cellar/openblas/0.2.14_1/lib #BLAS_INCLUDE := $(shell brew –prefix openblas)/include # Homebrew puts openblas in a directory that is not on the standard search path # Leave commented to accept the defaults for your choice of BLAS # Custom (MKL/ATLAS/OpenBLAS) include and lib directories. # CUDA directory contains bin/ and lib/ directories that we need. My config (lines which differ from original): How to build Caffe on Mac from scratchĪt first we have to edit nfig. If you encounter any errors, feel free to ask google or consult supplementary links. So, I uninstalled OpenBLAS and OpenCV, I built on my machine and made sure that I don’t have any out of date brew packages installed.Īll these steps of removing previously built libraries and setting up all the dependancies are covered in the section “Errors I encountered during the build”, in the mean time the following section should cover the steps required to build Caffe on Mac. IO libraries hdf5, leveldb, snappy, lmdb.Since I was building it with the default compiler, not the libstdc++, which works with CUDA Official Mac guide suggests that you might have BLAS installed, but I didn’t have it, so I used brew to get openblas (which also provides a speedup compared to BLAS)ĭownloading and building OpenCV from the official site was my primary mistake. I’ve applied, but they are still reviewing my application, so I built caffe without cuDNN support so far. Also you may want to apply for cuDNN - deep learning framework, which may also speed up picture generation later. You need to download it from the official site and make sure you download version 7.0+. This is the greatest problem, since CPU only version builds out-of-the-box. But in case you experience any, you can follow this guide. In the general case you should be able to install Caffe on Mac without any problems. There is an official manual for installation with the specific instructions about OS X part.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |