Keras Learning Environment Configuration-gpu accelerated version (Ubuntu 16.04 + CUDA8.0 + cuDNN6.0 + tensorflow)

Source: Internet
Author: User
Tags keras

This article is a personal summary of the Keras deep Learning framework configuration, the shortcomings please point out, thank you!

1. First, we need to install the Ubuntu operating system (under Windows) , which uses the Ubuntu16.04 version:

2. After installing the Ubuntu16.04, the system needs to be initialized and updated:

Open Terminal input:

System Upgrade:

→~ sudo apt-get update

→~ sudo apt-get upgrade

To install a base Dependent library:

→~ sudo apt-get install python-dev python-pip python-nose gcc g++ git gfortran libopenblas-dev liblapack-dev libatlas-base -dev

→~ sudo apt-get install setuptools wheel python-numpy python-scipy python-matplotlib

3. Installing the CUDA development environment

Download CUDA8.0:

Open the terminal and switch to the download directory:

→~ sudo dpkg-i cuda-repo-ubuntu1604-8-0-local-ga2_8.0.61-1_amd64.deb

→~ sudo apt-get update

→~ sudo apt-get install Cuda

After the installation is complete, configure the Cuda path:

→~ sudo gedit/etc/profile

Enter add at the end of the profile file ( Note: If you are not using version 8.0, you need to modify the version number ):

→~ Export cuda_home=/usr/local/cuda-8.0

→~ Export Path=/usr/local/cuda-8.0/bin${path:+:${path}}

→~ Export Ld_library_path=/usr/local/cuda-8.0/lib64${ld_library_path:+:${ld_library_path}}

After modification:

→~ Source/etc/profile

Verify that the configuration is successful:

→~ nvcc-v

The following message appears to be successful:

4. Installing the CUDNN Acceleration Library

This article uses the CUDA8.0, the corresponding installation cudnn-8.0-linux-x64-v6.0.tgz. Download extracted is a folder named Cuda, which contains bin, include, Lib, three folders copied to the location of the installation Cuda to overwrite the corresponding folder:

→~ cd/home/..../cudnn/

→~ sudo cp cuda/include/cudnn.h/usr/local/cuda/include
→~ sudo cp cuda/lib64/libcudnn*/usr/local/cuda/lib64

→~ sudo chmod a+r/usr/local/cuda/include/cudnn.h/usr/local/cuda/lib64/libcudnn*

5. Installing the Keras frame

→~ sudo pip install scikit-learn scikit-image

→~ sudo pip install TENSORFLOW-GPU # GPU Accelerated version

→~ sudo pip install Keras

Verify that the installation was successful in the terminal:

→~ Import TensorFlow

→~ Import Keras

If you do not error, the configuration is successful!

Keras Learning Environment Configuration-gpu accelerated version (Ubuntu 16.04 + CUDA8.0 + cuDNN6.0 + tensorflow)

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.