Code Monkey home page Code Monkey logo

tensorflow-udacity-vagrant's Introduction

Running TensorFlow Docker image under Windows

Summary

This Vagrant configuration allows you to run TensorFlow Docker image (from the Udacity Deep Learning course authors) on your Windows machine and share the assignments folder on the Windows machine with the TensorFlow Docker container, so that all your work will stay on your Windows machine.

Prerequisites

As Docker runs on Linux containers we would need to run a Linux Virtual Machine(VM) to be able to run Docker images. So first install Vagrant.

Before you run VM, make sure you have enough RAM and CPUs on your Windows machine. Current Vagrant configuration will use 2 CPUs and 8GB of RAM to run VM (Deep Learning course authors recommend using 8G). You can fix these numbers in Vagrantfile.

Make sure the following ports are not occupied by any other process and are free to use by VM:

  • 2222 - used to SSH into VM
  • 6006 - reserved for TensorBoard
  • 8888 - used by Jupyter Notebook

Preparing image for first use

  1. Clone this repository:

    > git clone https://github.com/dimchansky/tensorflow-udacity-vagrant
  2. Run VM with the Docker image (all Vagrant commands need to be run from the folder you've cloned repository to):

    > vagrant up tensorflow-udacity
  3. When VM is ready, open http://localhost:8888/ in your browser.

  4. At this point TensorFlow is almost ready, but you need to copy the assignments from Docker image to shared working folder (assignments folder on your Windows machine). So press the New button on the TensorFlow page in your browser and then press Terminal. Type the following commands in the Terminal:

    # cp -a /notebooks/. /assignments
    # chmod -R 666 /assignments
    # exit

    After this you can close the Terminal page and goto http://localhost:8888/. Now you should see all the assignments and are ready to get to work.

Shutdown/run the VM with the Docker image

Shutdown

When you're done with you work you can destroy docker container and halt the VM:

> vagrant destroy tensorflow-udacity
> vagrant halt

Please note that all your files will stay in ./assignments folder on your Windows machine.

Run

Next time you can run Docker container in the VM just by running the command:

> vagrant up tensorflow-udacity

The second time it will start faster, because it's already configured. When VM is ready just open http://localhost:8888/ in your browser and you'll see all your files from the assignments folder.

Tips & tricks

Logs

> vagrant docker-logs

command can be used to see the logs of a running TensorFlow Notebook. It can be useful to troubleshoot TensorFlow problems.

SSH

You can SSH into the VM by running the command (you should have ssh.exe in your Windows path):

> ssh vagrant@localhost -p 2222

The password is vagrant.

After you SSH into the VM you can run bash in the TensorFlow docker container by running the command:

$ docker exec -it tensorflow-udacity bash

Fully destroy the image of VM

The VM takes about 3GB on your disk (check your %USERPROFILE%/VirtualBox VMs folder). You can destroy this image when you're done with the course. All your assignments will stay in ./assignments folder on your Windows machine.

> vagrant destroy

You can also remove vagrant box that had been used to create a VM. The following command will show you all the boxes installed on your machine:

> vagrant box list

You should see something like:

phusion/ubuntu-14.04-amd64 (virtualbox, 2014.04.30)

Run the following command to remove the phusion/ubuntu-14.04-amd64 box:

> vagrant box remove phusion/ubuntu-14.04-amd64

tensorflow-udacity-vagrant's People

Contributors

dimchansky avatar

Stargazers

John Erling Blad avatar Chen Tao avatar Daniil avatar  avatar Mehrdad Arshad Rad avatar Alec Burgdorf avatar Halo Master avatar Alexandr Nikitin avatar

Watchers

Halo Master avatar  avatar James Cloos avatar Chen Tao avatar Daniil avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.