Coder Social home page Coder Social logo

dutchminator / keras-tensorflow-windows-installation Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jtkostman/keras-tensorflow-windows-installation

1.0 1.0 0.0 411 KB

10 easy steps to install Tensorflow-GPU and Keras in Windows. Forked to annotate with personal notes.

License: MIT License

keras-tensorflow-windows-installation's Introduction

Keras-TensorFlow-GPU-Windows-Installation

10 easy steps on the installation of TensorFlow-GPU and Keras in Windows. Updated as of 2017-11-22 based on my personal experience getting things running on a GTX1080 on Windows 10.

Step 1: Install Anaconda (latest Python 3 version) Download

Step 2: Update Anaconda

Open Anaconda Prompt to type the following command(s)

conda update conda
conda update --all

Step 3: Install CUDA Toolkit 8.0 GA2 Download

Choose your version depending on your Operating System

As of writing (2017-11-22), tensorflow-gpu==1.4.0 does not support the latest CUDA 9 yet on Windows. See tensorflow/tensorflow#14244 for progress. Make sure you get CUDA 8.0 and (separately) cuBLAS patch 2 from the CUDA download archives at https://developer.nvidia.com/cuda-80-ga2-download-archive .

Be aware that the CUDA installer's default Express settings will also install (old) video drivers and other non-CUDA-relevant software. This is part of the reason why the local installer is 1.3GB (!). I prefer the network version and I uncheck all the non-CUDA options.

Step 4: Download cuDNN 6.0 for CUDA 8 Download

Choose your version depending on your Operating System. Membership registration is required.

Put your unzipped folder in C drive as follows:

C:\cudnn-8.0-windows10-x64-v6.0

Step 5: Add cuDNN into Environment PATH

Press [Win]-R, and run the command:

sysdm.cpl

From here, edit your PATH variable by following these 3 steps:

Add the following path entry in your PATH system variable. Subjected to changes in your installation path.

C:\cudnn-8.0-windows10-x64-v6.0\cuda\bin

Turn off all the prompts, as they need to be restarted to use our new environment variables.

Alternatively, follow the instructions from NVIDIA in the cuDNN Install Guide. This is especially relevant if you develop in Visual Studio and want CUDA+cuDNN support there.

Step 6: Create an Anaconda environment

Open Anaconda Prompt to type the following command(s)

conda create -n tensorflow numpy scipy matplotlib spyder

Step 7: Activate the environment

Open Anaconda Prompt to type the following command(s)

activate tensorflow

Step 8: Install TensorFlow-GPU (1.4.0)

Install the latest version (==1.4.0 as of 2017-11-22) in our tensorflow environment:

pip install tensorflow-gpu

Step 9: Install Keras

Install the latest version of keras (==2.1.1 as of 2017-11-22) in our tensorflow environment:

pip install keras

Step 10: Testing

Let's try running mnist_mlp.py in your prompt.

Open Anaconda Prompt to type the following command(s)

activate tensorflow
python mnist_mlp.py

If you get no errors: Congratulations! You have successfully run Keras (with Tensorflow backend) over GPU on Windows!

Troubleshooting

If you get errors about missing .dll files, the first step is to make sure that your PATH system variable is correctly set up to point to two CUDA folders and your cuDNN folder, as shown in the screenshot in step 5. Then, make sure you have restarted your Anaconda Prompt to properly load the new PATH variable. Note that tensorflow-gpu is quite picky about which versions of CUDA and cuDNN are supported. At the moment of writing (2017-11-22), tensorflow-gpu==1.4.0 runs on CUDA 8.0GA2 with cuDNN v6.0. The error messages you get should reflect any version mismatches (e.g. cudart64_7.dll instead of cudart64_8.dll)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.