GithubHelp home page GithubHelp logo

shadowkun / docker-tensorflow-keras-gpu Goto Github PK

View Code? Open in Web Editor NEW

This project forked from afritzler/docker-tensorflow-keras-gpu

0.0 2.0 0.0 19 KB

Run Tensorflow and Keras with GPU support on Kubernetes

docker-tensorflow-keras-gpu's Introduction

docker-tensorflow-keras-gpu

Base image with Tensorflow and Keras with GPU support. The purpose of this project is to run a single Pod on Kubernetes on a GPU backed node.

Run it on Kubernetes

First, we need to label the gpu instance (if not already done). If you choose to use a different labeling, you need to adjust the nodeSelector part in the example-pod.yaml file.

kubectl label node <NODE_NAME> gpu="true"

Tricky part ahead:

In order to use the GPU inside your docker container, you need to pass the location of the NVidia driver on the host into your container. Since the GPU kernel driver on the host has to match the nvidia-driver inside the contianer, we want to decouple that. Adjust the path in the example-pod.yaml file in case your nvidia-driver location is different.

volumes:
  - name: nvidia-driver
    hostPath:
      path: /var/lib/nvidia-docker/volumes/nvidia_driver/latest

Now run a simple deployment

kubectl create -f example-pod.yaml

Attach to the running container

kubectl exec -it tensorflow-keras-gpu -- /bin/bash

Lets do some training

Inside the docker container I placed the Keras examples from github. To run a simple training example on the IMDB dataset

cd /keras/example
python imdb_cnn.py

If your configuration and driver mapping was done correctly, you should see something like that before the training starts.

Creating TensorFlow device (/gpu:0) -> (device: 0, name: GeForce GTX TITAN X, pci bus id: 0000:09:00.0)

References

docker-tensorflow-keras-gpu's People

Contributors

afritzler avatar

Watchers

 avatar  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.