GPU-enabled Keras using TensorFlow/ CNTK/ MXNET/ Theano backend.
10K+
This project is supported by HonghuTech, a Taiwanese Deep Learning Solutions ProviderHaving trouble setting-up environments for Deep Learning? We do this for you! From now on, you shall say goodbye to annoying messages such as "Build failed..." or "An error occurred during installation...".
Currently, we maintain the following docker images:
Apparently, all these environments support using Keras as the frontend.
See below for more details about these environments.
docker group. see [here] for Docker setup.10, which requires NVIDIA driver version >=410.XX. You can get the latest NVIDIA driver [here].The following tables list the docker images maintained by us. All these listed images are retrievable through Docker Hub.
Images within the repository: honghu/keras
| Keras Backend | Image's Tag | Description | Dockerfile | Suggested NV Driver |
|---|---|---|---|---|
| TensorFlow | tf-cu10.0-dnn7.4-py3-avx2-19.01 ; tf-latest | TensorFlow v1.12.0 ; Intel® Distribution for Python v2019.0-047 ; Keras v2.2.4 ; NCCL v2.3.7-1 | [Click] | R410 |
| TensorFlow | tf-cu9.2-dnn7.2-py3-avx2-18.10 | TensorFlow v1.11.0 ; Intel® Distribution for Python v2018.3-039 ; Keras v2.2.4 ; NCCL v2.2.13 | [Click] | R396 |
| TensorFlow | tf-cu9.2-dnn7.2-py3-avx2-18.09 | TensorFlow v1.10.1 ; Intel® Distribution for Python v2018.3-039 ; Keras v2.2.2 ; NCCL v2.2.13 | [Click] | R396 |
| TensorFlow | tf-cu9.2-dnn7.1-py3-avx2-18.08 | TensorFlow v1.10.0 ; Intel® Distribution for Python v2018.3-039 ; Keras v2.2.2 ; NCCL v2.2.13 | [Click] | R396 |
| TensorFlow | tf-cu9-dnn7-py3-avx2-18.03 | TensorFlow v1.6.0 ; Keras v2.1.5 | [Click] | R384 |
| TensorFlow | tf-cu9-dnn7-py3-avx2-18.01 | TensorFlow v1.4.1 ; Keras v2.1.2 | [Click] | R384 |
| MXNet | mx-cu10.0-dnn7.4-py3-19.01 ; mx-latest | MXNet v1.4.0.rc0 ; GluonCV v0.3.0 ; Intel® Distribution for Python v2019.0-047 ; Keras-MXNet v2.2.4.1 ; NCCL v2.3.7-1 | [Click] | R410 |
| MXNet | mx-cu9.2-dnn7.2-py3-18.10 | MXNet v1.3.0-dev ; GluonCV v0.3.0-dev ; Intel® Distribution for Python v2018.3-039 ; Keras-MXNet v2.2.4.1 ; NCCL v2.2.13 | [Click] | R396 |
| MXNet | mx-cu9.2-dnn7.2-py3-18.09 | MXNet v1.3.0-dev ; GluonCV v0.3.0-dev ; Intel® Distribution for Python v2018.3-039 ; Keras-MXNet v2.2.2 ; NCCL v2.2.13 | [Click] | R396 |
| MXNet | mx-cu9.2-dnn7.1-py3-18.08 | MXNet v1.3.0-dev ; GluonCV v0.3.0-dev ; Intel® Distribution for Python v2018.3-039 ; Keras-MXNet v2.2.0 ; NCCL v2.2.13 | [Click] | R396 |
| MXNet | mx-cu9-dnn7-py3-18.03 | MXNet v1.2.0 ; Keras-MXNet v2.1.3 | [Click] | R384 |
| MXNet | mx-cu9-dnn7-py3-18.01 | MXNet v1.0.1 ; Keras-MXNet v1.2.2 | [Click] | R384 |
| CNTK | cntk-cu10.0-dnn7.4-py3-19.01 ; cntk-latest | CNTK v2.6 ; Intel® Distribution for Python v2019.0-047 ; Keras v2.2.4 ; NCCL v2.3.7-1 | [Click] | R410 |
| CNTK | cntk-cu9.2-dnn7.2-py3-18.10 | CNTK v2.6 ; Intel® Distribution for Python v2018.3-039 ; Keras v2.2.4 ; NCCL v2.2.13 | [Click] | R396 |
| CNTK | cntk-cu9.2-dnn7.2-py3-18.09 | CNTK v2.5.1 ; Intel® Distribution for Python v2018.3-039 ; Keras v2.2.2 | [Click] | R396 |
| CNTK | cntk-cu9-dnn7-py3-18.08 | CNTK v2.5.1 ; Keras v2.2.2 | [Click] | R384 |
| CNTK | cntk-cu9-dnn7-py3-18.03 | CNTK v2.4 ; Keras v2.1.5 | [Click] | R384 |
| CNTK | cntk-cu8-dnn6-py3-18.01 | CNTK v2.2 ; Keras v2.1.2 | [Click] | |
| Theano | theano-cu9.0-dnn7.0-py3-18.09 ; theano-latest | Theano v1.0.2 ; Intel® Distribution for Python v2018.3-039 ; Keras v2.2.2 | [Click] | R384 |
| Theano | theano-cu9-dnn7-py3-18.03 | Theano v1.0.1 ; Keras v2.1.5 | [Click] | R384 |
| Theano | theano-cu9-dnn7-py3-18.01 | Theano v1.0.1 ; Keras v2.1.2 | [Click] | R384 |
Images within the repository: honghu/intelpython3
| Tag | Description | Dockerfile |
|---|---|---|
| gpu-cu10.0-dnn7.4-19.01 | Intel® Distribution for Python v2019.0-047 ; Ubuntu 18.04 | [Click] |
| gpu-cu9.2-dnn7.2-18.09 | Intel® Distribution for Python v2018.3-039 ; Ubuntu 18.04 | [Click] |
| gpu-cu9.0-dnn7.2-18.09 | Intel® Distribution for Python v2018.3-039 ; Ubuntu 16.04 | [Click] |
| gpu-cu9.2-dnn7.1-18.08 | Intel® Distribution for Python v2018.3-039 ; Ubuntu 18.04 | [Click] |
| cpu-18.09 | Intel® Distribution for Python v2018.3-039 ; Ubuntu 18.04 | [Click] |
| cpu-18.08 | Intel® Distribution for Python v2018.3-039 ; Ubuntu 18.04 | [Click] |
This environment can be obtained via:
docker pull honghu/keras:tf-cu10.0-dnn7.4-py3-avx2-19.01
which includes
v2.2.4v1.12.0v2019.0-047, including accelerated NumPy and scikit-learn.10.0, cuDNN7.4 and NCCL2.3.7-1.This environment can be obtained via:
docker pull honghu/keras:mx-cu10.0-dnn7.4-py3-19.01
which includes
v2.2.4.1v1.4.0.rc0v0.3.0v2019.0-047, including accelerated NumPy and scikit-learn.10.0, cuDNN7.4 and NCCL2.3.7-1.This environment can be obtained via:
docker pull honghu/keras:cntk-cu10.0-dnn7.4-py3-19.01
which includes
v2.2.4v2.610.0, cuDNN7.4 and NCCL2.3.7-1.Remark
This environment can be obtained via:
docker pull honghu/keras:theano-cu9.0-dnn7.0-py3-18.09
which includes
v2.2.2v1.0.29.0 and cuDNN7.0.Remark
Before you proceed to the next section, please get ndrun first:
# Create the "bin" directory if you don't have one inside your home folder.
if [ ! -d ~/bin ] ;then
mkdir ~/bin
fi
# Get the wrapper file and save it to "~/bin/ndrun".
wget -O ~/bin/ndrun https://raw.githubusercontent.com/chi-hung/DockerbuildsKeras/master/ndrun.sh
# Make the wrapper file executable.
chmod +x ~/bin/ndrun
ndrun is a tool that helps you to run a deep-learning environment. Before using it, please be sure to re-open your terminal in order to let the system know where this newly-added script ndrun is. In other words, make sure $HOME/bin is within your system's $PATH and then reload bash.
Remark:
ndrun has to be used along with the recent images (images made starting Sep. 2018). There's no garantee that it will work fine with the older images.Let's prepare a script that will import TensorFlow and print its version out:
# Create a script that prints TensorFlow's version.
printf "import tensorflow as tf \
\nprint('TensorFlow version=',tf.__version__)" \
> check_tf_version.py
Now, using ndrun, the script check_tf_version.py can be executed easily using our TensorFlow image. All you have to do is add ndrun before python3 check_tf_version.py:
ndrun python3 check_tf_version.py
And you should get the following output:
TensorFlow version= 1.12.0
which indicates that the current version of TensorFlow is 1.12.0. Now, the question then arises: where is this TensorFlow installed? Indeed, the TensorFlow's version you've seen is from the TensorFlow installed inside our latest TensorFlow image.
To activate another image, we can use the option -t [IMG_TYPE]. For example, let's now prepare a script that will import CNTK and print its version out:
# Create a script that checks CNTK's version.
printf "import cntk \
\nprint('CNTK version=',cntk.__version__)" \
> check_cntk_version.py
To run this script using the CNTK image, simply add the option -t cntk:
# Print CNTK's version out.
ndrun -t cntk python3 check_cntk_version.py
Its output:
CNTK version= 2.6
Currently, the possible choices of [IMG_TYPE] are:
tensorflowcntkmxnettheanoRemark
[IMG_TYPE], then, the latest image of that type will be selected.ndrun which image it should select.ndrun --help for more details.Now, let's retrieve an example from Google's GitHub repository aimed at handwritten-digits classification. This simple model (has only one hidden layer) is written in TensorFlow and MNIST is the dataset it's using.
# Get "mnist_with_summaries.py" from Google's GitHub repository.
wget https://raw.githubusercontent.com/tensorflow/tensorflow/master/tensorflow/examples/tutorials/mnist/mnist_with_summaries.py
Then, the retrieved script mnist_with_summaries.py can now be easily executed, via:
ndrun python3 mnist_with_summaries.py
The output should be similar to the following:
...
Extracting /tmp/tensorflow/mnist/input_data/train-labels-idx1-ubyte.gz
Successfully downloaded t10k-images-idx3-ubyte.gz 1648877 bytes.
Extracting /tmp/tensorflow/mnist/input_data/t10k-images-idx3-ubyte.gz
Successfully downloaded t10k-labels-idx1-ubyte.gz 4542 bytes.
Extracting /tmp/tensorflow/mnist/input_data/t10k-labels-idx1-ubyte.gz
WARNING:tensorflow:From /opt/intel/intelpython3/lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/datasets/mnist.py:290: DataSet.__init__ (from tensorflow.contrib.learn.python.learn.datasets.mnist) is deprecated and will be removed in a future version.
Instructions for updating:
Please use alternatives such as official/mnist/dataset.py from tensorflow/models.
2019-01-09 16:41:24.505114: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1432] Found device 0 with properties:
name: TITAN V major: 7 minor: 0 memoryClockRate(GHz): 1.455
pciBusID: 0000:04:00.0
totalMemory: 11.75GiB freeMemory: 11.34GiB
2019-01-09 16:41:24.505174: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1511] Adding visible gpu devices: 0
2019-01-09 16:41:25.018713: I tensorflow/core/common_runtime/gpu/gpu_device.cc:982] Device interconnect StreamExecutor with strength 1 edge matrix:
2019-01-09 16:41:25.018764: I tensorflow/core/common_runtime/gpu/gpu_device.cc:988] 0
2019-01-09 16:41:25.018771: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1001] 0: N
2019-01-09 16:41:25.019071: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1115] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 10957 MB memory) -> physical GPU (device: 0, name: TITAN V, pci bus id: 0000:04:00.0, compute capability: 7.0)
Accuracy at step 0: 0.0867
Accuracy at step 10: 0.7258
Accuracy at step 20: 0.8332
Accuracy at step 30: 0.8655
...
Content type
Image
Digest
Size
4.7 GB
Last updated
over 7 years ago
docker pull honghu/keras:tf-latest