You are on page 1of 5

AIST Jupyter Notebook Instructions

First-time Setup
1. Install ​Docker for Windows​, or ​Docker for Mac​.
a. If your system does not support Docker Windows/Mac, then install Docker
Toolbox (see ​Docker Toolbox for Windows​, ​Docker Toolbox for Mac​)

2. If you installed Docker Toolbox in Step 1, make sure to follow the instructions under the
Docker Toolbox Port Forwarding​ ​section of this document.

3. Open a terminal (on Mac), or a command prompt (on Windows), and execute the
following command:

docker run -it -p 8888:8888 -p 6006:6006 aista/aist-tutorial:latest bash

This will take a few minutes, as a 2 GB Docker image needs to be downloaded onto your
machine. Once this process completes, your terminal/prompt should automatically switch
to a Linux shell within a newly created Docker container.

The Linux shell should look similar to this (with a different container ID):

4. Once the Linux shell is ready, execute the following command to start a Jupyter
notebook server:

jupyter notebook --ip=0.0.0.0 --allow-root

5. After the Jupyter server starts, a URL will be displayed on the terminal, similar to below:

Navigate to this URL on your web browser to access the Jupyter server.

6. To open the notebook, click on the following file in the Jupyter directory:
Pulling Notebook Updates
In the event that an update is made to the notebook after you have already completed the
first-time setup, you’ll need to follow these instructions to pull the updates:

1. Find the container ID for the currently running Jupyter container:

docker ps

2. Stop the currently executing container:

docker stop CONTAINER_ID


(e.g. ​docker stop 9ea7898f312b​)

3. Pull the latest AIST Jupyter notebook Docker image:

docker pull aista/aist-tutorial

4. Follow steps 3-6 from the ​First-time Setup​ section of this document.

5. Note ​that following these steps will create a new container. Any work in progress on
existing notebooks will not be available in the new container. Stopping the new container
and re-starting an old container is an option to recover and migrate any work in progress.
a. If you’d like to completely remove the existing container, you may execute:

docker rm -f CONTAINER_ID
(e.g. ​docker rm -f 9ea7898f312b​)

Docker Toolbox Port Forwarding


Note: These instructions are only required if you are using Docker Toolbox, and are not required
if running Docker for Windows or Docker for Mac.

1. Open VirtualBox and find the Docker virtual machine (usually named ​default​).

2. Right click on the Docker VM and choose ​Settings…


3. Click on the ​Network ​tab, and expand the ​Advanced​ section

4. Click on ​Port Forwarding​.

5. Use the icon to add the following two rules (Jupyter-1, and Jupyter-2):

6. Click ​OK​.

7. Click ​OK​.
Recommendations
1. Save often while you are working on the notebook to avoid losing progress.

2. If you are running into issues with loss values not decreasing (or accuracy values not
increasing) while training a neural network, restarting the Jupyter Kernel may help.

This can be done by clicking on ​Kernel​, followed by ​Restart​.

Troubleshooting
1. If you encounter an input/output error when running the ​docker run​ command, try
restarting Docker for Windows/Docker for Mac, or your Docker Machine if you are using
Docker Toolbox.

2. Trying to navigate to the Jupyter notebook URL (e.g.


http://0.0.0.0:8888/?token=f572f3a5d083c108088b5ed573206e9c7a5cb45eee5a1470)
may result in an invalid address error. Try replacing the IP address with localhost if that
is the case. If you are using Docker Toolbox, make sure you forwarded the necessary
ports (see Docker Toolbox Port Forwarding).
3. If port 8888 is already in use by another running process on your machine, you may
change the Jupyter startup port as follows:

jupyter notebook --port=YOUR_DESIRED_PORT --ip=0.0.0.0 --allow-root

Note​ that if you decide to do this, you will need to use your desired port across all
instructions in this document (use your desired port in all instances where 8888 is
currently used).

You might also like