Skip to content

Instantly share code, notes, and snippets.

@EAboelhamd
Forked from ericjang/TensorFlow_Windows.md
Created November 20, 2016 14:26
Show Gist options
  • Select an option

  • Save EAboelhamd/76fa57f19e15eef3a3c237d8e62c4920 to your computer and use it in GitHub Desktop.

Select an option

Save EAboelhamd/76fa57f19e15eef3a3c237d8e62c4920 to your computer and use it in GitHub Desktop.

Revisions

  1. @ericjang ericjang revised this gist Dec 7, 2015. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions TensorFlow_Windows.md
    Original file line number Diff line number Diff line change
    @@ -15,15 +15,15 @@ You could also use Windows cmd.exe or Powershell.exe but they haveadditional con
    Launch the TensorFlow container.
    Set up port forwarding, mount contents of "thesis" directory into /home (the thesis folder doesn't show up, as its contents are mapped to the contents of /home.
    ```
    $ docker run -it -p 8888:8888 -v //c/Users/eric/Dropbox/thesis:/home b.gcr.io/tensorflow/tensorflow
    $ docker run -it -p 8888:8888 -p 6006:6006 -v //c/Users/eric/Dropbox/thesis:/home b.gcr.io/tensorflow/tensorflow
    ```
    The first time the command is run, it will Download and install TensorFlow. Afterwards,
    This should bring you into a Linux VM.

    The command above mounts a folder in your Windows host machine into the container. It's preferable to do things this way, because the container does not persist your files by default.

    It already comes with Jupyter installed, but you won't be able to access the notebooks by navigating
    to localhost:8888 (or whatever port Jupyter starts on).
    to localhost:8888 (or whatever port Jupyter starts on). You will also want to expose port 6006 to be able to use TensorBoard (currently, exposing a port on a live container is not possible).

    Instead, since it is running in a VM, not only do you need to forward the port (hence the -p 8888:8888), but the IP address you access
    needs to be the IP address of the VM, not the Windows Machine. Hence, you need to find the address of the docker machine running the container.
  2. @ericjang ericjang revised this gist Dec 7, 2015. 1 changed file with 5 additions and 0 deletions.
    5 changes: 5 additions & 0 deletions TensorFlow_Windows.md
    Original file line number Diff line number Diff line change
    @@ -85,4 +85,9 @@ If you want to attach another shell to the docker container:
    docker exec -it lonely_engelbart bash
    ```

    ### Increasing Memory on Docker Machine
    The docker-VM provided has default 1G memory, which is not sufficient to run the MNIST/CNN examples. You can configure the resource limits of the default Docker-machine VM from Virtualbox.

    See this page for more tips:
    http://blog.pavelsklenar.com/5-useful-docker-tip-and-tricks-on-windows/

  3. @ericjang ericjang revised this gist Dec 7, 2015. 1 changed file with 6 additions and 1 deletion.
    7 changes: 6 additions & 1 deletion TensorFlow_Windows.md
    Original file line number Diff line number Diff line change
    @@ -69,7 +69,12 @@ hello-world latest 0a6ba66e537a 7
    Let's say you installed a python package like ipdb and want to commit changes. Just do:

    ```
    docker commit <container_id> my/tensorflow
    docker commit lonely_engelbart ejang/tensorflow
    ```

    Subsequently,
    ```
    docker run ejang/tensorflow
    ```


  4. @ericjang ericjang revised this gist Dec 7, 2015. 1 changed file with 9 additions and 0 deletions.
    9 changes: 9 additions & 0 deletions TensorFlow_Windows.md
    Original file line number Diff line number Diff line change
    @@ -58,12 +58,21 @@ In the Docker Quickstart terminal,
    docker pull b.gcr.io/tensorflow/tensorflow-full
    ```

    ```
    $ docker images
    REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
    b.gcr.io/tensorflow/tensorflow-full latest edc3d721078b 3 weeks ago 2.284 GB
    b.gcr.io/tensorflow/tensorflow latest 217daf2537d2 4 weeks ago 652.6 MB
    hello-world latest 0a6ba66e537a 7 weeks ago 960 B
    ```

    Let's say you installed a python package like ipdb and want to commit changes. Just do:

    ```
    docker commit <container_id> my/tensorflow
    ```


    ### Moar Terminals

    If you want to attach another shell to the docker container:
  5. @ericjang ericjang revised this gist Dec 7, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion TensorFlow_Windows.md
    Original file line number Diff line number Diff line change
    @@ -61,7 +61,7 @@ docker pull b.gcr.io/tensorflow/tensorflow-full
    Let's say you installed a python package like ipdb and want to commit changes. Just do:

    ```
    sudo docker commit <container_id> my/tensorflow
    docker commit <container_id> my/tensorflow
    ```

    ### Moar Terminals
  6. @ericjang ericjang revised this gist Dec 7, 2015. 1 changed file with 25 additions and 4 deletions.
    29 changes: 25 additions & 4 deletions TensorFlow_Windows.md
    Original file line number Diff line number Diff line change
    @@ -1,15 +1,19 @@
    # Installing TensorFlow on Windows using Docker
    # TensorFlow development environment on Windows using Docker

    Here are instructions to set up TensorFlow dev environment on Docker if you are running Windows, and configure it so that you can access Jupyter Notebook from within the VM + edit files in your text editor of choice on your Windows machine.

    ## Installation
    First, install
    https://www.docker.com/docker-toolbox

    Since this is Windows, creating the Docker group "docker" is not necessary.

    ## Launching TensorFlow
    Open up "Docker Quickstart Terminal". It should bring up a MinGW-type shell.
    You could also use Windows cmd.exe or Powershell.exe but they haveadditional configurations that you need to do before you can run docker.exe

    Launch the TensorFlow container.
    Set up port forwarding, mount contents of "thesis" directory into /home.
    Set up port forwarding, mount contents of "thesis" directory into /home (the thesis folder doesn't show up, as its contents are mapped to the contents of /home.
    ```
    $ docker run -it -p 8888:8888 -v //c/Users/eric/Dropbox/thesis:/home b.gcr.io/tensorflow/tensorflow
    ```
    @@ -45,9 +49,26 @@ $ docker-machine ip default
    ```
    Navigate web browser to `192.168.99.100:8888` (or whatever webserver port your web app is running on) and you should be able to see your web apps.

    ## Moar Terminals
    ### Hacking on Source Code

    Let's say you want to use this container for your research environment. You'll want to clone the docker container so you can make changes to it.

    In the Docker Quickstart terminal,
    ```
    docker pull b.gcr.io/tensorflow/tensorflow-full
    ```

    Let's say you installed a python package like ipdb and want to commit changes. Just do:

    ```
    sudo docker commit <container_id> my/tensorflow
    ```

    ### Moar Terminals

    If you want to attach another shell to the docker container:
    ```
    docker exec -it lonely_engelbart bash
    ```
    ```


  7. @ericjang ericjang revised this gist Dec 6, 2015. 1 changed file with 8 additions and 1 deletion.
    9 changes: 8 additions & 1 deletion TensorFlow_Windows.md
    Original file line number Diff line number Diff line change
    @@ -43,4 +43,11 @@ default * virtualbox Running tcp://192.168.99.100:2376
    $ docker-machine ip default
    192.168.99.100
    ```
    Navigate web browser to `192.168.99.100:8888` (or whatever webserver port your web app is running on) and you should be able to see your web apps.
    Navigate web browser to `192.168.99.100:8888` (or whatever webserver port your web app is running on) and you should be able to see your web apps.

    ## Moar Terminals

    If you want to attach another shell to the docker container:
    ```
    docker exec -it lonely_engelbart bash
    ```
  8. @ericjang ericjang revised this gist Dec 6, 2015. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion TensorFlow_Windows.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,6 @@
    # Installing TensorFlow on Windows using Docker

    Here are instructions to set up TensorFlow dev environment on Docker if you are running Windows.
    Here are instructions to set up TensorFlow dev environment on Docker if you are running Windows, and configure it so that you can access Jupyter Notebook from within the VM + edit files in your text editor of choice on your Windows machine.

    First, install
    https://www.docker.com/docker-toolbox
  9. @ericjang ericjang created this gist Dec 6, 2015.
    45 changes: 45 additions & 0 deletions TensorFlow_Windows.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,45 @@

    Here are instructions to set up TensorFlow dev environment on Docker if you are running Windows.

    First, install
    https://www.docker.com/docker-toolbox

    Open up "Docker Quickstart Terminal". It should bring up a MinGW-type shell.
    You could also use Windows cmd.exe or Powershell.exe but they haveadditional configurations that you need to do before you can run docker.exe

    Launch the TensorFlow container.
    Set up port forwarding, mount contents of "thesis" directory into /home.
    ```
    $ docker run -it -p 8888:8888 -v //c/Users/eric/Dropbox/thesis:/home b.gcr.io/tensorflow/tensorflow
    ```
    The first time the command is run, it will Download and install TensorFlow. Afterwards,
    This should bring you into a Linux VM.

    The command above mounts a folder in your Windows host machine into the container. It's preferable to do things this way, because the container does not persist your files by default.

    It already comes with Jupyter installed, but you won't be able to access the notebooks by navigating
    to localhost:8888 (or whatever port Jupyter starts on).

    Instead, since it is running in a VM, not only do you need to forward the port (hence the -p 8888:8888), but the IP address you access
    needs to be the IP address of the VM, not the Windows Machine. Hence, you need to find the address of the docker machine running the container.

    Listing the docker containers

    ```
    $ docker ps
    CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
    4dd413d71153 b.gcr.io/tensorflow/tensorflow "/bin/bash" 2 minutes ago Up 2 minutes 6006/tcp, 0.0.0.0:8888->8888/tcp lonely_engelbart
    ```

    ```
    $ docker ps
    ```
    ```
    docker-machine ls
    $ docker-machine ls
    NAME ACTIVE DRIVER STATE URL SWARM ERRORS
    default * virtualbox Running tcp://192.168.99.100:2376
    $ docker-machine ip default
    192.168.99.100
    ```
    Navigate web browser to `192.168.99.100:8888` (or whatever webserver port your web app is running on) and you should be able to see your web apps.