[Caffe]linux installed Caffe (without cuda) and Mnist EXAMPLE

Source: Internet
Author: User
Tags git clone

Yesterday on the Mac toss a day is not installed successfully, at night on the Mac mounted a paralleldesktop virtual machine, and then installed Linux, 10 minutes to install, I was drunk =. =

The main process is slightly documented:

1. Installing Blas

sudo Install Libatlas-base-dev

2. Install dependencies

sudo apt-get install Libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libboost-all-dev Libhdf5-serial-dev Protobuf-compiler Liblmdb-dev

3. Installing Glog

This to FQ, I put on my Baidu cloud.

tar zxvf glog-0.3. 3. Tar . GZCD glog-0.3. 3 . /Configuremakesudomakeinstall

4. Installing gflags

 wget  https:// github.com/schuhschuh/gflags/archive/master.zip  unzip  Master.zip  cd gflags -master  mkdir  build && CD Buildexport cxxflags  = " -fpic  "  && CMake. && make  verbose=make  sudo  make  install  

This step requires CMake, if not installed, can be installed with sudo apt-get install CMake .

5. Installing Lmdb

git clone git://gitorious.org/mdb/mdb.gitcd mdb/libraries/liblmdbmakesudo  makeinstall

If you don't have git installed, install it with sudo apt-get install git .

6. Download Caffe

git clone git://github.com/bvlc/caffe.git

7. Installing Caffe

CP Makefile.config.example Makefile.config

Because there is no GPU here, you need to set cpu_only:= 1 in the Makefile.config file to remove the comment.

and then compile

 Make  All  Make Test  make Runtest

After installation we can try to run a lenet on the mnist.

1. Get Mnist Data first

CD Caffe. /data/mnist/get_mnist. SH

2. Then create the lenet, be sure to run the following command at the root of the Caffe, otherwise the "Build/examples/mnist/convert_mnist_data.bin:not found" error will be reported, see here. If there is no GPU, remember to set the Solver_mode in Caffe/examples/mnist/lenet_solver.prototxt to SOLVER_MODE:CPU.

./examples/mnist/train_lenet. SH

Accuracy can reach 0.9912

Reference

[1]http://blog.csdn.net/fengbingchun/article/details/45535741

[2]http://caffe.berkeleyvision.org/install_apt.html

[Caffe]linux installed Caffe (without cuda) and Mnist EXAMPLE

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.