{"id":19366284,"url":"https://github.com/afritzler/docker-tensorflow-keras-gpu","last_synced_at":"2025-06-24T08:04:21.499Z","repository":{"id":72823003,"uuid":"85558621","full_name":"afritzler/docker-tensorflow-keras-gpu","owner":"afritzler","description":"Run Tensorflow and Keras with GPU support on Kubernetes","archived":false,"fork":false,"pushed_at":"2017-03-21T14:32:55.000Z","size":19,"stargazers_count":13,"open_issues_count":0,"forks_count":5,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-23T14:41:41.142Z","etag":null,"topics":["deep-learning","docker","gpu","kubernetes","machine-learning","tensorflow"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/afritzler.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-03-20T09:34:54.000Z","updated_at":"2022-12-04T00:15:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"bcae46b4-4c94-4bda-be7f-0d4e8098aa1b","html_url":"https://github.com/afritzler/docker-tensorflow-keras-gpu","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/afritzler/docker-tensorflow-keras-gpu","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afritzler%2Fdocker-tensorflow-keras-gpu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afritzler%2Fdocker-tensorflow-keras-gpu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afritzler%2Fdocker-tensorflow-keras-gpu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afritzler%2Fdocker-tensorflow-keras-gpu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/afritzler","download_url":"https://codeload.github.com/afritzler/docker-tensorflow-keras-gpu/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afritzler%2Fdocker-tensorflow-keras-gpu/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261632138,"owners_count":23187269,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deep-learning","docker","gpu","kubernetes","machine-learning","tensorflow"],"created_at":"2024-11-10T07:43:50.493Z","updated_at":"2025-06-24T08:04:21.335Z","avatar_url":"https://github.com/afritzler.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# docker-tensorflow-keras-gpu\nBase 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.\n\n# Run it on Kubernetes\n\nFirst, 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.\n```\nkubectl label node \u003cNODE_NAME\u003e gpu=\"true\"\n```\n\n__Tricky part ahead:__\n\nIn 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. \n\n```\nvolumes:\n  - name: nvidia-driver\n    hostPath:\n      path: /var/lib/nvidia-docker/volumes/nvidia_driver/latest\n```\n\nNow run a simple deployment\n```\nkubectl create -f example-pod.yaml\n```\n\nAttach to the running container\n```\nkubectl exec -it tensorflow-keras-gpu -- /bin/bash\n```\n\n# Lets do some training\n\nInside the docker container I placed the Keras examples from github. To run a simple training example on the IMDB dataset\n```\ncd /keras/example\npython imdb_cnn.py\n```\nIf your configuration and driver mapping was done correctly, you should see something like that before the training starts.\n```\nCreating TensorFlow device (/gpu:0) -\u003e (device: 0, name: GeForce GTX TITAN X, pci bus id: 0000:09:00.0)\n```\n\n# References\n* https://www.tensorflow.org/\n* https://keras.io/\n* https://kubernetes.io/docs/user-guide/kubectl/kubectl_label/\n* https://kubernetes.io/docs/user-guide/kubectl/kubectl_create/\n* https://kubernetes.io/docs/user-guide/kubectl/kubectl_exec/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fafritzler%2Fdocker-tensorflow-keras-gpu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fafritzler%2Fdocker-tensorflow-keras-gpu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fafritzler%2Fdocker-tensorflow-keras-gpu/lists"}