Course information can be found at https://www.udacity.com/course/deep-learning--ud730
If you are new to Docker, follow Docker document to start a docker instance. Kindly read the requirements of Windows and Mac carefully.
docker run -p 8888:8888 --name tensorflow-udacity -it gcr.io/tensorflow/udacity-assignments:1.0.0
Note that if you ever exit the container, you can return to it using:
docker start -ai tensorflow-udacity
On linux, go to: http://127.0.0.1:8888
On mac, go to terminal and find the virtual machine's IP using:
docker-machine ip default
Then go to: http://(ip address received from the above command):8888 (likely http://192.168.99.100:8888)
On Windows, use powershell to find the virtual machine's IP using:
docker-machine ip default
Then go to: http://(ip address received from the above command):8888 (likely http://192.168.99.100:8888)
If you‘re using a Mac, Docker works by running a VM locally (which is controlled by docker-machine
). It’s quite likely that you'll need to bump up the amount of RAM allocated to the VM beyond the default (which is 1G). This Stack Overflow question has two good suggestions; we recommend using 8G.
In addition, you may need to pass --memory=8g
as an extra argument to docker run
.
docker-machine
is a tool to provision and manage docker hosts, it supports multiple platform (ex. aws, gce, azure, virtualbox, ...). To create a new virtual machine locally with built-in docker engine, you can use
docker-machine create -d virtualbox --virtualbox-memory 8196 tensorflow
-d
means the driver for the cloud platform, supported drivers listed here. Here we use virtualbox to create a new virtual machine locally. tensorflow
means the name of the virtual machine, feel free to use whatever you like. You can use
docker-machine ip tensorflow
to get the ip of the new virtual machine. To switch from default virtual machine to a new one (here we use tensorflow), type
eval $(docker-machine env tensorflow)
Note that docker-machine env tensorflow
outputs some environment variables such like DOCKER_HOST
. Then your docker client is now connected to the docker host in virtual machine tensorflow
If you get an error about the TLS connection of your docker, run the command below to confirm the problem.
docker-machine ip tensorflow
Then if it is the case use the instructions on this page to solve the issue.
This is a permissions issue, and a popular answer is provided for Linux and Max OSX here on StackOverflow.
cd tensorflow/examples/udacity docker build --pull -t $USER/assignments .
To run a disposable container:
docker run -p 8888:8888 -it --rm $USER/assignments
Note the above command will create an ephemeral container and all data stored in the container will be lost when the container stops.
To avoid losing work between sessions in the container, it is recommended that you mount the tensorflow/examples/udacity
directory into the container:
docker run -p 8888:8888 -v </path/to/tensorflow/examples/udacity>:/notebooks -it --rm $USER/assignments
This will allow you to save work and have access to generated files on the host filesystem.
V=1.0.0 docker tag $USER/assignments gcr.io/tensorflow/udacity-assignments:$V gcloud docker push gcr.io/tensorflow/udacity-assignments docker tag $USER/assignments gcr.io/tensorflow/udacity-assignments:latest gcloud docker push gcr.io/tensorflow/udacity-assignments