caffe+ubuntu14.0.4 64bit Environment Configuration instructions (no Cuda,caffe running on the CPU)--for--AMD

Source: Internet
Author: User
Tags intel mkl

Caffe is a concise and efficient deep learning framework, the specific introduction can be seen here, Caffe environment configuration process can refer to here, I built the environment when the collection of a lot of information, here to organize a bit, introduce caffe in the environment without cuda how to configure.

1. Installing Build-essentials

install some basic packages needed for development

sudo apt-get Install build-essential
If the essential package is unavailable, you can perform the following command to resolve the situation:
sudo apt-get update
2. Install Atlas for Ubuntu

Execute command:

sudo apt-get install libatlas-base-dev
Note: ATLAS, MKL, or Openblas, I choose to install ATLAS3 here. Installing OPENCV
Try not to install it manually, and someone on GitHub has already written the full installation script: Https://github.com/jayrambhia/Install-OpenCV
Download the script, unzip the ". zip" file, unzip the command:

Unzip/home/joe/install-opencv-master.zip
Go to the ubuntu/2.4 directory and add executable permissions to all shell scripts:

chmod +x *.sh
Then install the latest version (currently 2.4.9):

sudo./opencv2_4_9.sh
4. Installing Additional Dependencies

Ubuntu14.04 User Execution

sudo apt-get install Libprotobuf-dev libleveldb-dev libsnappy-dev Libopencv-dev Libboost-all-dev Libhdf5-serial-dev Libgflags-dev Libgoogle-glog-dev Liblmdb-dev Protobuf-compiler
Other systems can be used to refer to the official website.
5. Compiling Caffe
Complete the above environment configuration, you can compile Caffe!
Download Caffe installation package,: Https://github.com/BVLC/caffe
Unzip the package, unzip the command:

Unzip/home/joe/caffe-master.zip
Note: If there is an error in the decompression location, you can use the following command to delete the directory and all subdirectories:
sudo rm-rf caffe-master
Enter the Caffe root directory, first copy the Makefile.config, command:

CP Makefile.config.example Makefile.config
Then modify the contents (Makefile.config), the main parameters to be modified include: cpu_only whether only use CPU mode, because I do not have NVIDIA graphics card, there is no cuda, so need to open this option.
Some of the remaining configurations can be modified as needed:
BLAS (using Intel MKL or Openblas)
Matlab_dir If you need to use MATLAB wrapper you need to specify the installation path of MATLAB, such as my path is/usr/local/matlab/r2013b (note that the directory needs to include the Bin folder, The Bin folder should contain the MEX binaries)

If debug is using debug mode, open this option to debug the program in Eclipse or Nsight

When the above settings are complete, start compiling:

1. Make all-J4  2. Make Test  3. Make Runtest
Note:-j4 refers to the use of several threads at the same time to compile, can speed up, j after the number can be based on the number of CPU core to determine, if the CPU is 4 cores, the parameter is-J4, you can not add this parameter, directly use "make all", so the speed may be a bit slower.
6. Test with mnist DataSet CAFFE by default it will be installed in $caffe_root, which is the directory extracted to, for example: $ home/username/caffe-master, so the following work,
The working directory has been switched to this by default. The following work is mainly to test whether the Caffe is working properly and does not perform a detailed evaluation. Please refer to the website for specific settings:
Http://caffe.berkeleyvision.org/gathered/examples/mnist.html
(1) Data preprocessing
Can be downloaded with a good data set, you can re-download, the specific operation of the direct download is as follows:

1. $ cd caff-master   (go caff home dir)2. $ sudo sh data/mnist/get_mnist.sh
(2) To rebuild the ldb file, is to process the binary data set for caffe recognition of the data set, all future data, including the JPE file to be processed into this format, execute the command as follows:

$ sudo sh./examples/mnist/create_mnist.sh
Generate mnist-train-leveldb/and mnist-test-leveldb/folders, which contain data sets in LDB format
Note: The new Caffe will need to be executed from the root directory if executed using the following command:

1. # cd examples/mnist  2. # sudo sh./create_mnist.sh
You may encounter this error:./create_mnist.sh:16:./create_mnist.sh:build/examples/mnist/convert_mnist_data.bin:not found

(3) Training mnist
If there is no GPU, only the CPU, you need to modify the Examples/mnist directory Lenet_solver.prototxt file, the Solver_mode:gpu to SOLVER_MODE:CPU, the result is as follows:

1 . # solver mode:cpu or GPU   2. solver_mode:cpu
Modify can use the VI Edit command, if it is read-only files, cannot be edited, you can use the sudo command, such as:

sudo vi lenet_solver.prototxt

First enter the command mode, use a to enter the editing mode, after modifying, use ESC to exit the edit mode, enter the last line mode, and then use ": Wq" to save the changes and exit (": q!" To exit without saving changes)
After the modification is complete, execute the following command to train:

1. $ cd examples/mnist  2. $ sudo sh./train_lenet.sh

The final trained model is stored as a binary protobuf file, at which point all the steps of the Caffe installation are complete.
----------------------------------------------------------------------------------References:

Caffe Instance Test one: mnisthttp://blog.sciencenet.cn/blog-1583812-843207.htmlCaffe+ Ubuntu14.0464bit + CUDA6.5Configuration Instructions http://www.cnblogs.com/platero/p/3993877.htmlCNN's Caffe Configure http://www.cnblogs.com/alfredtofu/p/3577241.htmlTraining LeNet on MNIST with caffehttp://caffe.berkeleyvision.org/gathered/examples/mnist.htmlCaffe+ubuntu14.Geneva+CUDA6.5 Novice Installation Configuration Guide http://www.haodaima.net/art/2823705Caffe Installation Guide http://www.haodaima.net/art/2823705

.

caffe+ubuntu14.0.4 64bit Environment Configuration instructions (no Cuda,caffe running on the CPU)--for--AMD

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.