-
Notifications
You must be signed in to change notification settings - Fork 34
Installation
Warning
Keras with MXNet backend is still in experimental Beta phase. You can view the list of known issues and unsupported functionalities here.
Steps involved
- Install Keras dependencies - Numpy, Nose, Tensorflow and Theano
- Install Keras from source - https://github.com/dmlc/keras
- Install MXNet from source - https://github.com/dmlc/mxnet
Note:
The following installation instructions are tested on Ubuntu 14.04/16.04 and Mac OS EL Capitan and Sierra.
You need to install pip if not already installed. Then, follow the below installation commands to install Keras dependencies.
$ pip install numpy
$ pip install nose
$ pip install nose-parameterized
$ pip install Theano
# Refer https://www.tensorflow.org/install/ for more detailed Tensorflow installation instructions.
$ pip install tensorflow # For CPU machines
OR
$ pip install tensorflow-gpu # For GPU machines
# Clone keras repo to ~/keras directory
$ git clone https://github.com/dmlc/keras.git ~/keras --recursive
# Install Keras
$ cd ~/keras
$ sudo python setup.py install
Note
You need to install MXNet from latest source code to get Keras working with MXNet backend.
Go to MXNet Installation guide, choose "Linux or MacOS", choose "Python", choose "CPU or GPU", choose "Build from Source" and follow the installation guide to build and install MXNet with Python bindings.
You should set Keras backend to 'mxnet' to run your Keras code with MXNet backend. You can either set the environment variable or edit the keras config file.
Option 1
Set the environment variable
$ export KERAS_BACKEND=mxnet
Option 2
Edit the keras config file
Open "~/.keras/keras.json" file and set "backend=mxnet".
You can validate the installation by trying to import Keras in Python terminal and verifying that Keras is using mxnet backend.
$ python
>>> import keras as k
Using mxnet backend