caffe:mac10.12 Steps to install Caffe

Source: Internet
Author: User
Tags install homebrew git clone

Preface: Caffe official website installs the Caffe when involves the thing to be more and disorderly, actually some things can ignore.

Steps:

The mac10.12 itself comes with a python2.7 that can be used by the system's own python

1. Install Homebrew:

Enter Ruby-e "$ (curl-fssl https://raw.githubusercontent.com/Homebrew/install/master/install) in terminal

2. Install some dependent libraries needed for Caffe, enter the following lines in the terminal in turn

brew install -vd snappy leveldb gflags glog szip lmdb# need the homebrew science source for OpenCV and hdf5brew tap homebrew/sciencebrew install hdf5 opencv

# with Python pycaffe needs dependencies built from source

brew install --build-from-source --with-python -vd protobuf

brew install --build-from-source -vd boost boost-python

3. The Blas,caffe description (below) that is required to install the Caffe (below) is the Accelerate/veclib Framework that you can choose to use with your Mac, and you can choose Openblas and MKL. I didn't get the whole accelerate/veclib Framework, I chose to install Openblas.

Blas:already installed as the Accelerate/veclib Framework. Openblas and MKL is alternatives for faster CPU computation.

Download the Openblas source code and compile and install to the/usr/local directory:

Tar xvf openblas-0.2.19.tar.gz

CD OpenBLAS-0.2.19

make

make PREFIX=/usr/local install

Here, all the libraries that Caffe need to rely on are installed and started to install Caffe

4. Installing Caffe

Perform the following lines in the terminal:

git clone https://github.com/BVLC/caffe

cd /Users/XXX/caffe #caffe的

cp Makefile.config.example Makefile.config

You need to modify the Makefile.config file:

1. Remove the Cpu_only: = 1 Comment So that the Caffe can only run on the CPU

2. Change the configuration of the Blas

# BLAS Choice:

# Atlas for Atlas (default)

# MKL for MKL

# Open for Openblas

BLAS: = Open

# Custom (Mkl/atlas/openblas) include and Lib directories.

# Leave commented to accept the defaults for your choice of BLAS

# (which should work)!

Blas_include: =/usr/local/include

Blas_lib: =/usr/local/lib

Then execute on the terminal:

make all

make test

make runtest

If the Caffe installation is successful, it will appear as follows:

caffe:mac10.12 Steps to install Caffe

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.