All Projects → martinwicke → Tensorflow Tutorial

martinwicke / Tensorflow Tutorial

Licence: apache-2.0
A tutorial on TensorFlow

Projects that are alternatives of or similar to Tensorflow Tutorial

Kitti Dataset
Visualising LIDAR data from KITTI dataset.
Stars: ✭ 217 (-1.81%)
Mutual labels:  jupyter-notebook
Practical 1
Oxford Deep NLP 2017 course - Practical 1: word2vec
Stars: ✭ 220 (-0.45%)
Mutual labels:  jupyter-notebook
Timeseries fastai
fastai V2 implementation of Timeseries classification papers.
Stars: ✭ 221 (+0%)
Mutual labels:  jupyter-notebook
Hacktoberfest2020
A repo for new open source contributors to begin with open source contribution. Contribute and earn awesome swags.
Stars: ✭ 221 (+0%)
Mutual labels:  jupyter-notebook
Deform conv pytorch
PyTorch Implementation of Deformable Convolution
Stars: ✭ 217 (-1.81%)
Mutual labels:  jupyter-notebook
Spark Fm Parallelsgd
Implementation of Factorization Machines on Spark using parallel stochastic gradient descent (python and scala)
Stars: ✭ 220 (-0.45%)
Mutual labels:  jupyter-notebook
Python Awesome
Learn Python, Easy to learn, Awesome
Stars: ✭ 219 (-0.9%)
Mutual labels:  jupyter-notebook
Paperboy
A web frontend for scheduling Jupyter notebook reports
Stars: ✭ 221 (+0%)
Mutual labels:  jupyter-notebook
Stock Prediction
Stock price prediction with recurrent neural network. The data is from the Chinese stock.
Stars: ✭ 219 (-0.9%)
Mutual labels:  jupyter-notebook
Interview Prepartion Data Science
Stars: ✭ 220 (-0.45%)
Mutual labels:  jupyter-notebook
Edaviz
edaviz - Python library for Exploratory Data Analysis and Visualization in Jupyter Notebook or Jupyter Lab
Stars: ✭ 220 (-0.45%)
Mutual labels:  jupyter-notebook
Mirror
Visualisation tool for CNNs in pytorch
Stars: ✭ 219 (-0.9%)
Mutual labels:  jupyter-notebook
Materials
Bonus materials, exercises, and example projects for our Python tutorials
Stars: ✭ 3,211 (+1352.94%)
Mutual labels:  jupyter-notebook
Pytorch Deep Learning Template
A Pytorch Computer Vision template to quick start your next project! 🚀🚀
Stars: ✭ 220 (-0.45%)
Mutual labels:  jupyter-notebook
Interpret Text
A library that incorporates state-of-the-art explainers for text-based machine learning models and visualizes the result with a built-in dashboard.
Stars: ✭ 220 (-0.45%)
Mutual labels:  jupyter-notebook
Weightwatcher
The WeightWatcher tool for predicting the accuracy of Deep Neural Networks
Stars: ✭ 213 (-3.62%)
Mutual labels:  jupyter-notebook
Vae Clustering
Unsupervised clustering with (Gaussian mixture) VAEs
Stars: ✭ 220 (-0.45%)
Mutual labels:  jupyter-notebook
Dl For Chatbot
Deep Learning / NLP tutorial for Chatbot Developers
Stars: ✭ 221 (+0%)
Mutual labels:  jupyter-notebook
Pythondemo
虾神的Python示例代码库
Stars: ✭ 221 (+0%)
Mutual labels:  jupyter-notebook
Fauxtograph
Tools for using a variational auto-encoder for latent image encoding and generation.
Stars: ✭ 220 (-0.45%)
Mutual labels:  jupyter-notebook

TensorFlow tutorial

This codelab contains three lessons:

  • Introduction to TensorFlow with Linear Regression
  • MINST with Deep Learning
  • Deepdream

These are all presented via Jupyter notebooks. To run them on your machine, you will need a working TensorFlow installation (v0.10.0RC0).

Below are instructions on how to set up a TensorFlow environment using Docker.

Setup

Docker runs your notebooks from a virtual machine. Docker images already contain installed and compiled versions of TensorFlow.

Note: it’s quite possible to install TensorFlow natively on your machine (and this is recommended for long-term experimentation), but for simplicity we have docmented only the Docker procedure here.

Prerequisites:

  • A Mac or Ubuntu Linux machine (Docker will work on Windows, but the step-by-step instructions here may not work perfectly since we have not tried them)
  • Some knowledge of Python

Ubuntu Linux

The overall Linux setup commands for TensorFlow are on tensorflow.org.

In summary, you will need to:

  • Install Docker on your machine.
  • Create a Docker group to allow launching containers without sudo.
  • Launch a Docker container with the TensorFlow image.

You should check your installation by running:

docker run hello-world

To check TensorFlow, you can start a TensorFlow docker image by running this:

docker run -it -p 8888:8888 tensorflow/tensorflow:0.10.0rc0 bash

Check to see if your TensorFlow works by invoking Python from the container’s command line (you’ll see [email protected]#):

# python

import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))

If you see "Hello, Tensorflow", everything is in order. You should exit your docker instance (type exit), and go to the section *Downloading This Repository.

Mac OS X:

If you already have the Docker Toolbox installed, skip to "Installing/running a TensorFlow Docker Image." Otherwise, go to docs.docker.com/mac/ and follow the instructions there, which should roughly be:

Download the Docker Toolbox.

  • On the Toolbox page, find the Mac version.
    • Download a DockerToolbox-1.xx.xx.pkg file (180MB).
    • Run that downloaded pkg to install the Toolbox.
    • At the end of the install process, choose the Docker Quickstart Terminal.
    • Open a terminal window and follow the installation script.
  • If you have already installed Toolbox, just run the Docker Quickstart Terminal in /Applications/Docker/.
  • Launch the Docker Quickstart Terminal
    • This may take some time the first time to make an SSH connection.
  • Run the suggested command in the terminal to confirm Docker installation has worked:
docker run hello-world

Troubleshooting OS X

On OS X, you may see:

Error checking TLS connection: Something went wrong running an SSH command!
command : ip addr show
err     : exit status 255

At which point you may have to destroy and recreate your docker instance like so:

docker-machine rm default
docker-machine create --driver virtualbox default

Installing and Running the TensorFlow Image

On OS X, if you have not already, run the Docker Quickstart Terminal, usually found in /Applications/Docker, and which looks like this:

Quickstart Terminal Icon

There will be a long pause as the Docker container starts and gets an SSH keys and an IP address.

Once you see an ASCII whale in the newly-opened terminal, run this command:

docker run -it tensorflow/tensorflow:0.10.0rc0 bash

Check to see if your TensorFlow works by invoking Python from the container’s command line (you’ll see [email protected]#):

# python

import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))

If you see "Hello, Tensorflow!", it works!

Running Faster on OS X

Training takes a long time, even a limited run like this. It helps to provide a lot of CPU and memory resources if you can.

On OS X, these Docker instances are running on VirtualBox, and VirtualBox by default doesn’t take over huge parts of your computer. TensorFlow will take a lot of resources, so it’s worth increasing the resources allocated to it.

  • Find VirtualBox in your Application folder, and open it.

  • Stop the running process, if there is one

    • Right-click on “Default” and choose Stop -> Close ACPI Shutdown
  • Click on Settings, then System

  • Choose Motherboard and boost the RAM to the edge of the green area.

  • Click on Processor, and, again, boost that to the edge of the green area.

  • Click OK.

  • Restart the VirtualBox instance by right-clicking on “default” and choosing Start -> Headless Start, then wait a bit until it's Running.

  • Re-run the Docker Quickstart Terminal.

  • Your session will have ended. Optionally, you can verify that the Docker image still works:

docker run hello-world

Downloading This Repository

This is not rocket science, but do keep track of where you've installed this.

git clone https://github.com/martinwicke/tensorflow-tutorial.git $HOME/tensorflow-tutorial

Run Docker with Jupyter and TensorBoard

Note: On Mac OS X, if you have not already opened a Docker Quickstart Terminal, you must do so now.

Go to where you cloned the repository (we're assuming $HOME):

cd $HOME
docker run  -v $HOME/tensorflow-tutorial:/tutorial -p 0.0.0.0:6006:6006 -p 0.0.0.0:8888:8888 -it tensorflow/tensorflow:0.10.0rc0 bash

This will start a Docker instance with the tutorial materials mounted at /tutorial.

(Note: All further commands are run in the Docker image, so your prompt will be [email protected][something]#).

Once started, run the Jupyter server in the right directory.

cd /tutorial
/run_jupyter.sh &

You will also want to run TensorBoard:

tensorboard --logdir=`pwd` &

On Linux: You can navigate to:

On OSX: You can navigate to:

or whichever local address your VM has on your machine.

TensorBoard is available in a similar place, either http://localhost:6006 or http://192.168.100.99:6006 on MacOS.

On OS X, you can find the exact address under the whale where you started your terminal, shown here:

Docker whale image

When You're Done

To exit Docker, you can simply enter exit or hit Ctrl-D.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].