install keras + tensorflow (GPU) to Windows using anaconda

  1. Install Tensorflow and Keras
    1. Run Anaconda Prompt
    2. Install Tensorflow
      # pip install tensorflow-gpu
    3. Install Keras
      # pip install keras
  2. (Optional) Change Keras’ backend from Theano to TensorFlow
    1. This step is optional if Keras uses Theano as its backend.
    2. Start python and import keras
      # python
      # import keras
    3. If Theano is set as the backend, the terminal says “Using Theano backend
    4. Find the setting file location
      1. Find the location of Keras’ setting file. Executing the following 2 lines, the terminal shows the location where the Keras’ setting file is stored.
        # import os
        # print(os.path.expanduser(‘~’))
        NAME_OF_DIRECTORY (in my case it’s C:\User\USERNAME)
    5. Change the backend
      1. Open NAME_OF_DIRECTORY.keras\keras.json
      2. Change  “th” to “tf
      3. Change “theano” to “tensorflow
  3. run any Keras example

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s