Keras Learning Environment configuration-GPU accelerated version (Ubuntu 16.04 + CUDA8.0 + cuDNN6.0 + Tensorflow), keras-gpu

Source: Internet
Author: User

Keras Learning Environment configuration-GPU accelerated version (Ubuntu 16.04 + CUDA8.0 + cuDNN6.0 + Tensorflow), keras-gpu

This article is my personal summary of the deep learning framework configuration of Keras. Please point out the disadvantages. Thank you!

1. First, we need to install the Ubuntu operating system (also in Windows). Ubuntu is used here:

2. After Ubuntu16.04 is installed, You need to initialize and update the system:

Open the terminal and enter:

System Upgrade:

→ ~ Sudo apt-get update

→ ~ Sudo apt-get upgrade

Install the basic dependency 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. Install 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

At the end of the profile file, press enter to add (Note: If you are not using version 8.0, you must 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 whether the configuration is successful:

→ ~ Nvcc-V

The following information is successful:

 

4. Install the cuDNN acceleration Library

This article uses CUDA8.0, the corresponding installation cudnn-8.0-linux-x64-v6.0.tgz. Download and decompress the folder named cuda, which contains bin, include, and lib. Copy the three folders to the place where CUDA is installed and 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. Install the Keras framework

→ ~ Sudo pip install scikit-learn scikit-image

→ ~ Sudo pip install tensorflow-gpu # GPU accelerated version

→ ~ Sudo pip install keras

Verify whether the installation is successful on the terminal:

→ ~ Import tensorflow

→ ~ Import keras

If no error is reported, the configuration is successful!

 

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.