Giter VIP home page Giter VIP logo

keras-tensorflow-windows-installation's Introduction

Keras-TensorFlow-GPU-Windows-Installation

Installation instructions for TensorFlow and Keras on Windows.

1. Install Miniconda python

Miniconda installers contain the conda package manager and Python. Once Miniconda is installed, you can use the conda command to install any other packages and create environments, etc.

1.1: Install Miniconda (Python 3.6 version) Download

1.2: Update conda

Run Anaconda Prompt as administrator

and type the following command(s)

conda update conda
conda update --all

1.3: Install python IDE

Install your favorite python IDE (Visual Studio Code, Python Tools for Visual Studio, PyCharm, Ninja...)

2. If you have GPU, install CUDA and cuDNN

2.1: Install CUDA Tookit 8.0 Download

Choose your version depending on your Operating System

For more information, refer to official documentation.

2.2: Download cuDNN 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-v5.1

2.3: Add cuDNN into Environment PATH Tutorial

Add the following path in your Environment. Subjected to changes in your installation path.

C:\cudnn-8.0-windows10-x64-v5.1\cuda\bin

Close all prompts. Open a new command prompt and type the following command

echo %PATH%

You shall see that the new Environment PATH is there.

3. Install TensorFlow

3.1: Create an Anaconda environment with Python=3.6

Open Anaconda prompt (as an administrator) and type the following command

conda create -n tensorflow python=3.6

3.2: Activate TensorFlow environment

In the command prompt type the following command

activate tensorflow

3.3: Install TensorFlow package

If you have a GPU, install GPU version of TensorFlow by running the following command

pip install --ignore-installed --upgrade tensorflow-gpu

If you don't have a GPU, install CPU version of TensorFlow by running the following command

pip install --ignore-installed --upgrade tensorflow

For more information, refer to official documentation.

4. Install Keras

In the command prompt type the following command

pip install keras

5. Test the installation

Let's try running examples/mnist_mlp.py in your Anaconda prompt.

Open Anaconda prompt in the examples folder and type the following commands

activate tensorflow
python mnist_mlp.py

You should see output similar to this:

Using TensorFlow backend.
60000 train samples
10000 test samples
_________________________________________________________________
Layer (type)                 Output Shape              Param #
=================================================================
dense_1 (Dense)              (None, 512)               401920
_________________________________________________________________
dropout_1 (Dropout)          (None, 512)               0
_________________________________________________________________
dense_2 (Dense)              (None, 512)               262656
_________________________________________________________________
dropout_2 (Dropout)          (None, 512)               0
_________________________________________________________________
dense_3 (Dense)              (None, 10)                5130
=================================================================
Total params: 669,706
Trainable params: 669,706
Non-trainable params: 0
_________________________________________________________________
Train on 60000 samples, validate on 10000 samples
Epoch 1/20
60000/60000 [==============================] - 5s 77us/step - loss: 0.2414 - acc: 0.9264 - val_loss: 0.1263 - val_acc: 0.9584
Epoch 2/20
60000/60000 [==============================] - 3s 43us/step - loss: 0.1028 - acc: 0.9690 - val_loss: 0.0846 - val_acc: 0.9746
...
...
...
Epoch 20/20
60000/60000 [==============================] - 3s 44us/step - loss: 0.0163 - acc: 0.9959 - val_loss: 0.1230 - val_acc: 0.9831
Test loss: 0.123033428495213
Test accuracy: 0.9831

Congratulations! You have successfully run Keras (with Tensorflow backend) on Windows!

keras-tensorflow-windows-installation's People

Contributors

antoniosehk avatar movasi avatar

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.