Skip to content
This repository has been archived by the owner on Sep 18, 2021. It is now read-only.

Devtography/swift-tf-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Swift for TensorFlow - Docker

Swift + TensorFlow logo

An Ubuntu 18.04 Docker image for Swift for TensorFlow.

You can find the Docker Hub repo here: https://hub.docker.com/r/devtography/swift-tf

Supported tags & respective Swift for TensorFlow version

Tag Swift for TensorFlow
1.0.1, latest v0.5.0
1.0.0 v0.5.0

* Append -cuda postfix for GPU supported images

Usage

Pull the Docker image from Docker Hub:
# CPU only
docker pull devtography/swift-tf

# With CUDA support
docker pull devtography/swift-tf:latest-cuda
Create a container from the image and run it:
docker run -it devtography/swift-tf

If you want to run the Swift REPL you will need to run the container with additional privileges:

docker run --security-opt seccomp=unconfined -it devtography/swift-tf

For GPU support on Linux, install NVIDIA Docker support and run a GPU-enabled Swift for TensorFlow image:

  • Take note of your Docker version with docker -v. Versions earlier than 19.03 require nvidia-docker2 and the --runtime=nvidia flag. On versions including and after 19.03, you will use the nvidia-container-toolkit package and the --gpus all flag.
# Docker version >= 19.03
docker run --gpus all -it devtography/swift-tf:latest-cuda

# Docker version < 19.03
docker run --runtime=nvidia -it devtography/swift-tf:latest-cuda

Note from official Swift for TensorFlow installation doc:

If you are using a CUDA build and you have an NVIDIA GPU with a compute capability other than 3.5 or 7.0, then you will experience a ~10 minute delay the first time you execute a TensorFlow operation, while TensorFlow compiles kernels for your GPU's compute capability. The program will not print anything out and it will appear to be frozen.

Remarks

Jupyter Notebook support

Jupyter Notebook support for Swift is NOT included in the docker images. If you would like to try Swift for TensorFlow in a Jupyter Notebook, Google's Colaboratory provides a free an no setup required environment that runs entirely in the cloud with GPU support.

For more details, please follow the usage document of Swift for TensorFlow.

Contributions

Contributions via pull requests are welcome and encouraged :)

License

swift-tf-docker is licensed under the Apache License, Version 2.0.