Dockerized Swift for TensorFlow with Jupyter and GPU Support.
nvidia-docker run -ti --rm \
--privileged \
--userns=host \
\
-v "$(pwd)":/notebooks \
--entrypoint /bin/bash \
zixia/swift
--privileged
and--userns=host
might be required for some docker deamon configuration. (see this issue)
nvidia-docker run -ti --rm \
-p 8888:8888 \
--cap-add SYS_PTRACE \
-v "$(pwd)":/notebooks \
zixia/swift
The functions of these parameters are:
-p 8888:8888
exposes the port on which Jupyter is running to the host.--cap-add SYS_PTRACE
adjusts the privileges with which this container is run, which is required for the Swift REPL.-v <host path>:/notebooks
bind mounts a host directory as a volume where notebooks created in the container will be stored. If this command is omitted, any notebooks created using the container will not be persisted when the container is stopped.
To run a local file main.swift
form the current path:
nvidia-docker run -ti --rm \
--privileged \
--userns=host \
\
-v "$(pwd)":/notebooks \
zixia/swift \
swift ./main.swift
After building the docker image according to the instructions above,
docker run --rm \
--cap-add SYS_PTRACE \
zixia/swift \
python3 /swift-jupyter/test/all_test_docker.py
Init version based on Swift-Jupyter, working under Ubuntu 19.04 without any problem.
- Swift-Jupyter
- Dockerized Swift for TensorFlow and advanced usage examples.
- Swift for tensorflow using GPU with nvidia docker
- Code & Docs © 2019-now Huan LI (李卓桓) [email protected]
- Code released under the Apache-2.0 License
- Docs released under Creative Commons