• Stars
    star
    1,477
  • Rank 31,827 (Top 0.7 %)
  • Language
    Jupyter Notebook
  • License
    Apache License 2.0
  • Created over 8 years ago
  • Updated over 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

ARCHIVED: Contains historical course materials/Homework materials for the FREE MOOC course on "Creative Applications of Deep Learning w/ Tensorflow" #CADL

Build Status Slack Channel

Creative Applications of Deep Learning w/ Tensorflow

This repository contains lecture transcripts and homework assignments as Jupyter Notebooks for the first of three Kadenze Academy courses on Creative Applications of Deep Learning w/ Tensorflow. It also contains a python package containing all the code developed during all three courses.

COURSE 1: Creative Applications of Deep Learning with TensorFlow I
Session 1: Introduction to TensorFlow
Session 2: Training A Network W/ TensorFlow
Session 3: Unsupervised And Supervised Learning
Session 4: Visualizing And Hallucinating Representations
Session 5: Generative Models

COURSE 2: Creative Applications of Deep Learning with TensorFlow II
Session 1: Cloud Computing, GPUs, Deploying
Session 2: Mixture Density Networks
Session 3: Modeling Attention with RNNs, DRAW
Session 4: Image-to-Image Translation with GANs

COURSE 3: Creative Applications of Deep Learning with TensorFlow III
Session 1: Modeling Music and Art: Google Brain’s Magenta Lab
Session 2: Modeling Language: Natural Language Processing
Session 3: Autoregressive Image Modeling w/ PixelCNN
Session 4: Modeling Audio w/ Wavenet and NSynth

Github Contents Overview

Session Description Transcript Homework
Python Package pycadl Python package required for courses 2 and 3 N/A N/A
Installation Installation Setting up Python/Notebook and necessary libraries. N/A N/A
Preliminaries Preliminaries with Python Basics of working with Python and images. N/A N/A
1 Computing with Tensorflow Working with a small dataset of images. Dataset preprocessing. Tensorflow basics. Sorting/organizing a dataset. lecture-1.ipynb Colab session-1.ipynb
2 Basics of Neural Networks Learn how to create a Neural Network. Learn to use a neural network to paint an image. Apply creative thinking to the inputs, outputs, and definition of a network. lecture-2.ipynb session-2.ipynb
3 Unsupervised and Supervised Learning Build an autoencoder. Extend it with convolution, denoising, and variational layers. Build a deep classification network. Apply softmax and onehot encodings to classify audio using a Deep Convolutional Network. lecture-3.ipynb session-3.ipynb
4 Visualizing Representations Visualize backpropped gradients, use them to create Deep Dream, extend Deep Dream w/ regularization. Stylize images or synthesize new images with painterly or hallucinated aesthetics of another image. lecture-4.ipynb session-4.ipynb
5 Generative Models Build a Generative Adversarial Network and extend it with a Variational Autoencoder. Use the latent space of this network to perform latent arithmetic. Build a character level Recurrent Neural Network using LSTMs. Understand different ways of inferring with Recurrent Networks. lecture-5.ipynb session-5-part-1.ipynb, session-5-part-2.ipynb

Installation Preliminaries

The first course makes heavy usage of Jupyter Notebook. This will be necessary for submitting the homeworks and interacting with the guided session notebooks I will provide for each assignment. Follow along this guide and we'll see how to obtain all of the necessary libraries that we'll be using. By the end of this, you'll have installed Jupyter Notebook, NumPy, SciPy, and Matplotlib. While many of these libraries aren't necessary for performing the Deep Learning which we'll get to in later lectures, they are incredibly useful for manipulating data on your computer, preparing data for learning, and exploring results.

Quickstart Guide

Please skip this section and read the rest of this readme if you are unfamiliar w/ Jupyter Notebook or installing Python libraries. This section is only for advanced users who want to get started quickly.

There are two ways to get started. You can use a native pip installation or use Docker. There is a quickstart guide for both methods below. If you have trouble with these, then please skip to the more in depth guides below these sections.

Method 1: pip Install

For those of you that are proficient w/ Python programming, you'll need Python 3.4+ and the latest TensorFlow which you can install via pip, e.g.:

$ pip install tensorflow

or w/ CUDA as:

$ pip install tensorflow-gpu

Method 2: Docker Installation

If you want a controlled environment w/ all dependencies installed for you, and are proficient w/ Docker and Jupyter, you can get started w/ this repo like so:

$ cd
$ git clone --recursive https://github.com/pkmital/CADL.git
$ cd CADL
$ docker build -t cadl .
$ docker run -it -p 8888:8888 -p 6006:6006 -v /$(pwd)/session-1:/notebooks --name tf cadl /bin/bash

Note that you can skip the build step and download from docker hub instead like so:

$ docker run -it -p 8888:8888 -p 6006:6006 -v /$(pwd)/session-1:/notebooks --name tf pkmital/cadl /bin/bash

Be sure to replace "session-1" with whichever session you are working on, e.g. "session-2", "session-3"... This will give you a bash prompt with the files for each session:

root@39c4441bcde8:/notebooks# ls
README.md  lecture-1.ipynb  libs  session-1.ipynb  tests

Which you can use to launch jupyter like so:

root@39c4441bcde8:/notebooks# jupyter notebook --allow-root
[I 01:45:27.712 NotebookApp] [nb_conda_kernels] enabled, 2 kernels found
[I 01:45:27.715 NotebookApp] Writing notebook server cookie secret to /root/.local/share/jupyter/runtime/notebook_cookie_secret
[W 01:45:27.729 NotebookApp] WARNING: The notebook server is listening on all IP addresses and not using encryption. This is not recommended.
[I 01:45:27.799 NotebookApp] [nb_anacondacloud] enabled
[I 01:45:27.802 NotebookApp] [nb_conda] enabled
[I 01:45:27.856 NotebookApp] βœ“ nbpresent HTML export ENABLED
[W 01:45:27.856 NotebookApp] βœ— nbpresent PDF export DISABLED: No module named 'nbbrowserpdf'
[I 01:45:27.858 NotebookApp] Serving notebooks from local directory: /notebooks
[I 01:45:27.858 NotebookApp] 0 active kernels
[I 01:45:27.858 NotebookApp] The Jupyter Notebook is running at: http://[all ip addresses on your system]:8888/?token=dd68eeffd8f227dd789327c981d16b24631866e909bd6469
[I 01:45:27.858 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).

Jupyter should then be running if you navigate Google Chrome (suggested!) to "http://localhost:8888". If you navigate to the session-1.ipynb file, you will see the homework, or to "lecture-1.ipynb", to find the lecture transcripts. The same goes for every other session.

If you need to relaunch the docker image again, you can write:

$ cd
$ cd CADL
$ docker start -i tf

If you want to use a GPU version, and have a Linux machine, and have an NVIDIA GPU, you can use nvidia-docker (this only works for Linux machines! for non-Linux machines that want to use GPU, please follow the expanded directions below, or the quickstart pip installation above):

$ wget -P /tmp https://github.com/NVIDIA/nvidia-docker/releases/download/v1.0.0-rc.3/nvidia-docker_1.0.0.rc.3-1_amd64.deb
$ sudo dpkg -i /tmp/nvidia-docker*.deb && rm /tmp/nvidia-docker*.deb
$ nvidia-docker build -t cadl-gpu -f Dockerfile-gpu .
$ nvidia-docker run -it -p 8888:8888 -p 6006:6006 -v /$(pwd)/session-1:/notebooks --name tf cadl-gpu /bin/bash 
$ nvidia-docker start -i tf

If you had any trouble w/ this setup then please go through the rest of this document which provides much more in depth details.

What is Notebook?

Jupyter Notebook, previously called "iPython Notebook" prior to version 4.0, is a way of interacting with Python code using a web browser. It is a very useful instructional tool that we will be using for all of our homework assignments. Notebooks have the file extensions "ipynb" which are abbreviations of "iPython Notebook". Some websites such as nbviewer.ipython.org or www.github.com can view .ipynb files directly as rendered HTML. However, these are not interactive versions of the notebook, meaning, they are not running the python kernel which evaluates/interacts with the code. So the notebook is just a static version of the code contained inside of it.

In order to interact with notebook and start coding, you will need to launch Terminal (for Mac and Linux users). For Windows users, or for anyone having any problems with the Linux/Mac instructions, please follow the next section on Docker Toolbox very closely! If you are not a Windows user, please first try skipping over the next section and use the installation instructions in Jupyter Notebook before trying Docker as this solution will be much faster than running Docker.

Docker Toolbox

Currently, Windows users can only install Tensorflow via pip using a 64-bit Python 3.5 environment or using Docker, as outlined below.

The easiest way to get up an running on any type of system is to use Docker. Docker is a way of managing a "virtual" Linux machine on your computer which will aid the creation a machine capable of running Tensorflow. First, please download and install the Docker Toolbox:

https://www.docker.com/products/docker-toolbox

Linux users can install docker using their favorite package manager.

For OSX and Windows users, you'll then need to run the "Docker Quickstart Terminal" which will launch a Terminal environment running on a virtual Linux machine on your computer. A virtual machine is basically an emulation of another machine. This is important because we'll use this machine to run Linux and install all of the necessary libraries for running Tensorflow.

Note for Windows users, if you have trouble launching the Docker Quickstart Terminal because you have "Hyper-V", please instead try using https://docs.docker.com/docker-for-windows/. Then launch the newly installed "Docker CLI" program.

Once the Terminal is launched, either via Docker CLI or Docker Quickstart Terminal, run the following command (ignoring the $ sign at the beginning of each line, which just denote that each line is a terminal command that you should type out exactly and then hit ENTER afterwards):

$ cd
$ docker-machine ip

If you are using Docker Toolbox, you should see your virtual machine's IP address as a result of the last command. This is the location of your virtual machine. NOTE THIS IP ADDRESS, as we'll need it in a second. If you are using "Docker for Windows" instead, then you won't need this IP as we'll just use "localhost".

This next command will move to your "home" directory. We'll then "clone" the github repo. This will download everything for the course using "git". If you have trouble w/ this step, make sure you have installed git.

$ cd
$ git clone --recursive https://github.com/pkmital/CADL.git

We'll now print out what the full path to that directory is. PLEASE NOTE DOWN THIS DIRECTORY. This is where everything will happen, and I'll explain that in a minute.

$ echo /$(pwd)/CADL

Now run the following command, which will download everything we need to run tensorflow, python, and jupyter notebook (again, ignore the "$" at the beginning of the line only)!

$ docker run -it -p 8888:8888 -p 6006:6006 -v /$(pwd)/CADL:/notebooks --name tf pkmital/cadl

What this is doing is: * Running the docker image pkmital/cadl * --name is giving it a shorthand name of "tf" * -v is mirroring the directory "/$(pwd)/CADL" to the virtual machine's directory of "/notebooks" * -p is forwarding ports from the virtual machine to your local machine so that you can access the virtual machine's port * -it is running it as an interactive process

You will want to put files inside the "/notebooks" directory only. If you place files on the virtual machine outside of the "/notebooks" directory, which is the SAME as the "CADL" directory on your local machine, they will not be saved. We are using Docker to mirror the "CADL" directory on a virtual machine which has everything necessary for us to code in Python and Tensorflow. Whatever is in that directory will be mirrored on the virtual machine's directory under /notebooks.

You can also try running the docker run command with any other directory. For instance:

$ docker run -it -p 8888:8888 -p 6006:6006 -v /Users/YOURUSERNAME/Desktop:/notebooks --name tf pkmital/cadl

Which would mean that your Desktop is where you can move files around so that on the virtual machine, you can interact with them under the /notebooksdirectory.

For OSX users, if you are installing Docker because you had installation problems using Anaconda and pip, you would instead write the following command (note the missing slash):

$ docker run -it -p 8888:8888 -p 6006:6006 -v $(pwd)/CADL:/notebooks --name tf pkmital/cadl

When you want to start this machine, you will launch the Docker Quickstart Terminal and then write:

$ cd
$ docker start -i tf

Notice that the command prompt will now be # instead of $. You should have a new folder "tensorflow" inside your Home directory. This directory will be empty to begin with. Please make sure you do everything inside this directory only or else any files you make on your virtual machine WILL BE ERASED once it is shutdown! When you clone the CADL repository, or expand the zip file downloads contents inside this directory via your Windows machine (it will be in your Home directory under a folder "cadl"), then you will be able to access it via your Docker instance.

For instance, after running the docker start -i tf command, try going into the directory /notebooks:

# cd /notebooks

Jupyter Notebook

OSX/Linux

Note: Windows/Docker users should scroll past this section to "Windows/Docker". For OSX/Linux users, the easiest way to ensure you have Python 3.4 or higher and Jupter Notebook is to install Anaconda for Python 3.5 located here:

OSX or Linux

Make sure you restart your Terminal after you install Anaconda as there are some PATH variables that have to be set.

Then run the following:

$ curl https://bootstrap.pypa.io/ez_setup.py -o - | python

If you already have conda, but only have Python 2, you can very easily add a new environment w/ Python 3 and switch back and forth as needed. Or if you do not have Anaconda, but have a system based install, I'd really recommend either using Anaconda or pyenv to help you manage both python installations.

With Anaconda installed, you will have python and the package "ipython[notebook]", along with a ton of other very useful packages such as numpy, matplotlib, scikit-learn, scikit-image, and many others.

With everything installed, restart your Terminal application (on OSX, you can use Spotlight to find the Terminal application), and then navigate to the directory containing the "ipynb", or "iPython Notebook" file, by "cd'ing" (pronounced, see-dee-ing), into that directory. This involves typing the command: "cd some_directory". Once inside the directory of the notebook file, you will then type: "jupyter notebook". If this command does not work, it means you do not have notebook installed! Try installed anaconda as above, restart your Terminal application, or manually install notebook like so (ignore the "$" signs which just denote that this is a Terminal command that you should type out exactly and then hit ENTER!):

$ pip3 install ipython[notebook]
$ jupyter notebook

If you run into issues that say something such as:

[W 20:37:40.543 NotebookApp] Kernel not found: None

Then please try first running:

$ ipython3 kernel install
### Windows/Docker Containers

For users running firewalls, you must make sure you have an exception as per Jupyter Notebooks Firewall Instructions otherwise you may not be able to interact with the notebook. Namely, you will need to allow connections from 127.0.0.1 (localhost) on ports from 49152 to 65535. Once inside your Docker container as outlined above, you can now launch notebook like so:

$ cd /notebooks
$ jupyter notebook &

Note on Virtual versus Windows Directories:

This is tricky to grasp, mostly because I didn't explain it. Docker is "virtual" computer running inside your computer. It has its own filesystem and its own directories. So you can't reference your Windows machine's directories inside this machine. When you first ran docker (e.g. $ docker run -it -p 8888:8888 -p 6006:6006 -v /$(pwd)/tensorflow:/notebooks --name tf pkmital/cadl) it included as part of its command: -v /$(pwd)/tensorflow:/notebooks. What that was doing is "mirroring" a directory on your Windows machine inside your Virtual machine. So whatever was in your Windows machine under the directory /$(pwd)/tensorflow would appear in the Virtual machine under /notebooks. That Windows directory is likely /Users/<YOURUSERNAME>/tensorflow. So ONLY inside that directory, create it if it doesn't exist, should you put files in order to access it on the Virtual machine.

So let's say your Username was "pkmital". Then your home directory would be /Users/pkmital, and you would have mirrored /Users/pkmital/tensorflow on your Windows Machine to the Virtual machine under /notebook. Now let's say I create a directory /Users/pkmital/tensorflow/images on my Windows Machine, and then put a bunch of png files in there. I will then see them in my Virtual machine under /notebook/images. If I put the CADL repository inside /Users/pkmital/tensorflow, then I should have /Users/pkmital/tensorflow/CADL/session-1/session-1.ipynb and on the Virtual machine, it will be in /notebooks/CADL/session-1/session-1.ipynb - From this notebook, running on the virtual machine, accessed with Jupyter Notebook, I would access my images like so:

import os
os.listdir('../../images')

Navigating to Notebook

After running "jupyter notebook &", you should see a message similar to:

root@182bd64f27d2:~# jupyter notebook &
[I 21:15:33.647 NotebookApp] Writing notebook server cookie secret to /root/.local/share/jupyter/runtime/notebook_cookie_secret
[W 21:15:33.712 NotebookApp] WARNING: The notebook server is listening on all IP addresses and not using encryption. This is not recommended.
[W 21:15:33.713 NotebookApp] WARNING: The notebook server is listening on all IP addresses and not using authentication. This is highly insecure and not recommended.
[I 21:15:33.720 NotebookApp] Serving notebooks from local directory: /root
[I 21:15:33.721 NotebookApp] 0 active kernels
[I 21:15:33.721 NotebookApp] The IPython Notebook is running at: http://[all ip addresses on your system]:8888/
[I 21:15:33.721 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).

Don't worry if the IP address or command prompt look different. Note where it says: The IPython Notebook is running at. If you are running Docker (Windows users), this is where we need that IP address. For OSX/Linux users, we'll use "localhost" so don't worry about this. Now open up Chrome/Safari/Firefox whatever browser you like, and then navigate to:

http://localhost:8888

or for Windows users:

http://ADDRESS:8888

where ADDRESS is the ip address you should have noted down before. For instance, on my machine, I would visit the website:

http://192.168.99.100:8888

This will launch the Jupyter Notebook where you will be able to interact with the homework assignments!

Installing Python Packages

Packages are libraries or useful extensions to the standard python libraries. In this course, we'll be using a few including Tensorflow, NumPy, MatPlotLib, SciPy, SciKit-Image, and SciKit-Learn. Windows users will already have these libraries since the Docker container includes these. However, if you needed to, you can install these using "pip", which is the python package manager. OSX/Linux users should follow these steps just to be sure they have the latest versions of these packages. In Python 3.4 and higher, pip comes with any standard python installation. In order to use pip, first make sure you are using the correct version. One way to do this is check which pip you are running:

$ which pip
$ which pip3

Use which pip points to the install path that makes the most sense (e.g. Anaconda for OSX users for some reason does not symlink pip3 to the python3 pip, and instead points to the system version of python3).

Then you'll write:

$ pip3 install -U pip setuptools

To make sure you have an up to date pip, then:

$ pip3 install some_package

To get the necessary libraries:

$ pip3 install "scikit-image>=0.11.3" "numpy>=1.11.0" "matplotlib>=1.5.1" "scikit-learn>=0.17"

This should get you all of the libraries we need for the course, EXCEPT for tensorflow. Tensorflow is a special case, but can be pip installed in much the same way by pointing pip to the github repo corresponding to your OS like so.

Ubuntu/Linux 64-bit for Python 3.4

$ pip3 install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.11.0rc1-cp34-cp34m-linux_x86_64.whl

Ubuntu/Linux 64-bit for Python 3.5

$ pip3 install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.11.0rc1-cp35-cp35m-linux_x86_64.whl

OSX for Python 3.4 or Python 3.5

$ pip3 install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.11.0rc1-py3-none-any.whl

Other Linux/OSX varieties

You can pip install Tensorflow for most OSX/Linux setups including those that are making use of NVIDIA GPUs and CUDA using one the packages listed on this link: https://github.com/tensorflow/tensorflow/blob/master/tensorflow/g3doc/get_started/os_setup.md#pip-installation

If you are having trouble with pip installation, try looking here first: Common Installation Problems. Failing that, reach out to us on the forums, or else you may want to instead run a Docker instance as outlined in the Windows instructions above: Setting up a Docker Container.

CUDA/GPU instructions

Note that I have not provided instructions on getting setup w/ CUDA as it is beyond the scope of this course! If you are interested in using GPU acceleration, I highly recommend using Ubuntu Linux and setting up a machine on Nimbix or Amazon EC2 using the instructions here: https://github.com/tensorflow/tensorflow/blob/master/tensorflow/g3doc/get_started/os_setup.md#optional-install-cuda-gpus-on-linux. If you're using Nimbix, you can skip the install process as there is already a machine pre-installed w/ Tensorflow. Similarly, for Amazon EC2, there are many existing "images" of machines that have Tensorflow already installed.

Testing it

To confirm it worked, try running:

$ python3 -c 'import tensorflow as tf; print(tf.__version__)'

You should see 1.0.0 printed, depending on which version you have installed.

CUDA/GPU instructions for MacOS

When your Mac is equipped with a NVidia graphics card, you can use the GPU for computing with Tensorflow. GPU enabled computing is not supported for Macs with ATI or Intel graphics cards.

If you have a previous cpu installation of tensorflow, uninstall it first:

$ pip3 uninstall tensorflow

Using homebrew, install the following packages:

$ brew install coreutils
$ brew tap caskroom/cask
$ brew cask install cuda

Once you have the CUDA Toolkit installed you will need to setup the required environment variables by adding the following to your ~/.profile:

export CUDA_HOME=/usr/local/cuda
export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:$CUDA_HOME/lib"
export PATH="$CUDA_HOME/bin:$PATH"

Tensorflow needs the library libcuda.1.dylib, so we have to create an additional symbolic link:

sudo ln -sf /usr/local/cuda/lib/libcuda.dylib /usr/local/cuda/lib/libcuda.1.dylib

Finally, you will also want to install the CUDA Deep Neural Network (cuDNN v5) library which currently requires an Accelerated Computing Developer Program account. Once you have it downloaded locally, you can unzip and move the header and libraries to your local CUDA Toolkit folder:

$ sudo mv include/cudnn.h /Developer/NVIDIA/CUDA-8.0/include/
$ sudo mv lib/libcudnn* /Developer/NVIDIA/CUDA-8.0/lib
$ sudo ln -s /Developer/NVIDIA/CUDA-8.0/lib/libcudnn* /usr/local/cuda/lib/

Then, finally, install tensorflow with GPU support with:

$ pip3 install --ignore-installed --upgrade tensorflow-gpu

According to the instructions of the TensorFlow website, this should work. However, on MacOS 10.11 (El Capitan) and above, the environment variable DYLD_LIBRARY_PATH is ignored, resulting in an error in the interactive python console and JetBrains PyCharm IDE. The dynamic library libcudart.8.0.dylib fails to load. This is due to a new protection meganism in MacOS 10.11 and higher. El Capitan ships with a new OS X feature: System Integrity Protection (SIP), also known as β€œrootless” mode. This reduces the attack surface for malware that relies on modifying system files by preventing any user, whether with system administrator (β€œroot”) privileges or not from modifying a number of operating system directories and files.

Warning: The point of SIP is to prevent malware and other unwanted modifications into system files. Consider whether or not you want to dispense with this protection. Follow these steps to disable SIP:

  • Restart your Mac.
  • Before OS X starts up, hold down Command-R and keep it held down until you see an Apple icon and a progress bar. Release. This boots you into Recovery.
  • From the Utilities menu, select Terminal.
  • At the prompt type exactly the following and then press Return: csrutil disable
  • Terminal should display a message that SIP was disabled.
  • From the ο£Ώ menu, select Restart.

You can re-enable SIP by following the above steps, but using csrutil enable instead.

Troubleshooting

ImportError: No module named 'tensorflow'

You may have different versions of Python installed. You can troubleshoot this by looking at the output of:

$ which python3
$ which pip3
$ python3 --version
$ pip3 --version
$ which python
$ which pip
$ python --version
$ pip --version

You may simply need to install tensorflow using pip instead of pip3 and/or use python instead of python3, assuming they point to a version of python which is Python 3 or higher.

AttributeError: module 'tensorflow' has no attribute '__version__'

You could be running python inside a directory that contains the folder "tensorflow". Try running python inside a different directory.

GPU-related issues

If you encounter the following when trying to run a TensorFlow program:

ImportError: libcudart.so.7.0: cannot open shared object file: No such file or directory

Make sure you followed the GPU installation instructions. If you built from source, and you left the Cuda or cuDNN version empty, try specifying them explicitly.

Protobuf library related issues

TensorFlow pip package depends on protobuf pip package version 3.0.0b2. Protobuf's pip package downloaded from PyPI (when running pip install protobuf) is a Python only library, that has Python implementations of proto serialization/deserialization which can be 10x-50x slower than the C++ implementation. Protobuf also supports a binary extension for the Python package that contains fast C++ based proto parsing. This extension is not available in the standard Python only PIP package. We have created a custom binary pip package for protobuf that contains the binary extension. Follow these instructions to install the custom binary protobuf pip package :

# Ubuntu/Linux 64-bit:
$ pip install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/protobuf-3.0.0b2.post2-cp27-none-linux_x86_64.whl

# Mac OS X:
$ pip install --upgrade https://storage.googleapis.com/tensorflow/mac/protobuf-3.0.0b2.post2-cp27-none-any.whl

and for Python 3 :

# Ubuntu/Linux 64-bit:
$ pip3 install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/protobuf-3.0.0b2.post2-cp34-none-linux_x86_64.whl

# Mac OS X:
$ pip3 install --upgrade https://storage.googleapis.com/tensorflow/mac/protobuf-3.0.0b2.post2-cp35-none-any.whl

Install the above package after you have installed TensorFlow via pip, as the standard pip install tensorflow would install the python only pip package. The above pip package will over-write the existing protobuf package. Note that the binary pip package already has support for protobuf larger than 64MB, that should fix errors such as these :

[libprotobuf ERROR google/protobuf/src/google/protobuf/io/coded_stream.cc:207] A
protocol message was rejected because it was too big (more than 67108864 bytes).
To increase the limit (or to disable these warnings), see
CodedInputStream::SetTotalBytesLimit() in google/protobuf/io/coded_stream.h.

Cannot import name 'descriptor'

ImportError: Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/tensorflow/core/framework/graph_pb2.py", line 6, in <module>
    from google.protobuf import descriptor as _descriptor
ImportError: cannot import name 'descriptor'

If you the above error when upgrading to a newer version of TensorFlow, try uninstalling both TensorFlow and protobuf (if installed) and re-installing TensorFlow (which will also install the correct protobuf dependency).

Can't find setup.py

If, during pip install, you encounter an error like:

...
IOError: [Errno 2] No such file or directory: '/tmp/pip-o6Tpui-build/setup.py'

Solution: upgrade your version of pip:

pip install --upgrade pip

This may require sudo, depending on how pip is installed.

SSLError: SSL_VERIFY_FAILED

If, during pip install from a URL, you encounter an error like:

...
SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed

Solution: Download the wheel manually via curl or wget, and pip install locally.

Jupyter Notebook Kernel is always busy (Windows)

If your have installed Docker Toolbox on Windows but your jupyter notebook doesn't run properly (the notebook kernel keeps busy all the time when you open any file) then you might need to try different browsers (One guy tried Edge and it solved his problem after struggling for long time on Chrome/Firefox).

And you should also enable port forwarding by:

  1. Open VirtualBox
  2. Click on your default docker image.
  3. Click Settings.
  4. Click Network.
  5. Click forward port.
  6. Add a new rule named jupyter with host ip=127.0.0.1 and host/guess port=8888
  7. Now you should be able to browse your notebook app via localhost:8888 (instead of having to browse 192.168.xx.xx:8888)

Something Else!

Post on the Forums or check on the Tensorflow README

More Repositories

1

tensorflow_tutorials

From the basics to slightly more interesting applications of Tensorflow
Jupyter Notebook
5,615
star
2

pycadl

Python package with source code from the course "Creative Applications of Deep Learning w/ TensorFlow"
Python
364
star
3

time-domain-neural-audio-style-transfer

NIPS2017 "Time Domain Neural Audio Style Transfer" code repository
Python
134
star
4

dance2dance

Discrete Figures AI: Seq2Seq of Dance Data (Mikiko + Daito Manabe + Kyle McDonald)
Python
59
star
5

pkmFace

facial shape modeling, appearance modeling, and head pose recognition. Uses Jason Mora Saragih's FaceTracker code to track facial landmarks; GreatYao's aam-library for building/reprojecting the model (which may in fact be an uncited port of Jason's DeMoLib).
C++
46
star
6

Real-Time-Object-Detection

real time object detection using opencv and simple UI to select the object to track
C++
37
star
7

flask-uwsgi-tensorflow

Example of serving a TensorFlow model with Flask and UWSGI
Python
25
star
8

pkmFFT

pkmFFT provide simple interfaces to the Accelerate.framework for performing vectorized FFT. pkmSTFT builds on pkmFFT to perform Short Time Fourier Transform efficiently using vectorized ops. Also handles options for windowing. pkmDCT provides a simple discrete cosine transform using Accelerate and pkmMatrix.
C++
23
star
9

KinectHandAnalysis

Does finger tracking, contour analysis, and different types of shape description for the hand contour using a 3D ROI around the hand-tracked by NITE middleware, using OpenCV 2.2, an OpenGL scene, and OpenNI.
C
23
star
10

CycleGAN

Describing CycleGAN (excerpt from CADL course on Kadenze, Inc.)
Jupyter Notebook
19
star
11

ofxCaffe

openFrameworks addon for visualizing and interfacing with pre-trained models in Caffe: Convolutional Architectures for Fast Feature Embedding. Requires Caffe, openFrameworks 64-bit, glog, hdf5, OpenCV, CUDA, pkmMatrix, and pkmHeatmap. Pre-trained models not included but can be found linked in Caffe's "Model Zoo" and placed in the bin/data directory of the example project.
C
17
star
12

MTEC-498-698A-01-Algorithmic-Sound

Generative Sound Practice w/ OpenFrameworks
C++
14
star
13

MTIID-MTEC-616-01-2017

Materials for "Audiovisual Interaction w/ Machine Learning", Bachelors (416) and Graduate (616) course @ CalArts MTIID MTEC
C++
12
star
14

autoEncoderSynthesis

Performs interactive audio synthesis using a previously trained auto encoder. VIsualizes hidden layer and allows for interaction with hidden units. W/ Andy Sarroff. See Andy's github (woodshop) for more interesting projects using Deep Learning and audio synthesis.
C
12
star
15

pkmOpticalFlow

Interface for OpenCV's TV-L1 Duality Based Approach to Optical Flow. Does some additional tricks to speed up processing, allow for analysis of the spatio-temporal changes in flow, and visualize the results.
C++
12
star
16

StickFigureOSC

Streams PrimeSense NITE's Skeleton Data via OSC (XCode Project)
C
8
star
17

pkmAudio

Sound synthesis library. Implements a number of feature databses including frame-based, segment-based, and sequence-based audio analysis/storing/retrieval. Also includes libraries for GPS-based synthesis including binarualization retrieval. Complements many other libraries including pkmBinaural and Memory Mosaic. Heavy dependence on vectorized ops using pkmMatrix and OSX's library Accelerate.
C++
8
star
18

CARPE

CARPE is "Computational Algorithmic Representation and Processing of Eye-movements". It supports visualizations of film/eye-movements in columnar format, peak-through visualizations, heatmaps, optical flow analysis, gaze clustering, and many other visualization options. See http://thediemproject.wordpress.com for more details. Compuational and Algorithmic Representation and Processing of Eye-movements - OSX Version
C++
7
star
19

pkmSIFTImage

Creates a dense SIFT image description and displays the image based on a PCA reprojection. Based on SIFT Flow code by Ce Lui, Jenny Yuen, and Antonio Torralba.
C++
7
star
20

pkmBlobTracker

Background modeling for foreground subtraction, tracks multiple blobs (people), their orientations (using leading motion vector), and has a nice visual display for seeing the results... video demonstration here: http://vimeo.com/22054133 - more info here: http://pkmital.com
C
7
star
21

phdThesis

Ph.D. Thesis from Goldsmiths, University of London entitled, "Audiovisual Scene Synthesis". Hosts all images and latex files.
TeX
6
star
22

pkmColorBlobTracker

track overhead using color and map tracked points to a new geometry using a homography transformation and calibration routine - some example test videos are provided in the bin/data directory of an overhead capture. The tracking transformation is useful for when you need a defined metric space of your tracking parameters, or need to account for different user heights in tracking their paths in a space.
C
5
star
23

NSCARPE

CARPE is "Computational Algorithmic Representation and Processing of Eye-movements". It supports visualizations of film/eye-movements in columnar format, peak-through visualizations, heatmaps, optical flow analysis, gaze clustering, and many other visualization options. CARPE using NSWindow, Multiple Heatmaps, XML file settings, Difference of Heatmaps, GPU optimizations
C++
5
star
24

CEMA

openFrameworks projects from my course at Srishti's School of Art, Design and Technology's Center for Experimental Media: http://pkmital.com/home/teaching/cema-workshop/
C++
4
star
25

pkmPhaseVocoder

Phase vocoder using pkmFFT and pkmMatrix. Does not seem to do as well as commerical applications. Would love it if anyone made use of this and improved upon it.
C++
4
star
26

ofxiTunesLibraryStream

simple way to stream 32-bit float data from itunes in real-time
Objective-C
4
star
27

pkmDetector

3d Object Tracking and Pose Estimation for the iPhone
C++
4
star
28

seq2seq

Exploring audio modeling / synthesis w/ seq2seq
Python
4
star
29

videoSPAM

[in progress] synthesis of audiovisual material from youtube!
Python
3
star
30

pkmKalman

Kalman filter optimized for iOS/OSX
C++
3
star
31

pkmMatrix

pkmMatrix provides a lightweight Matrix class using the Accelerate.framework for vectorized operations
C++
3
star
32

pkmProjectionMapper

openFrameworks based projection mapping for distorting or mapping a collection of drawing commands/videos/images etc... needed a lightweight and robust projection mapping utility though lpmt was too heavy. homography code stolen from lpmt.
C++
3
star
33

eegShapeAnimations

testing some encoding/decoding using EEG. this produces various animations that are co-registered with the recording of eeg.
C++
2
star
34

pkmDPGMM

Interfacing libcluster for doing Variational Dirichlet Process Gaussian Mixture Models. Depends on Eigen3 and pkmMatrix. Libcluster included.
C++
2
star
35

eegLogger

For streaming/logging emotiv eeg headset data
C++
2
star
36

pkmBinaural

For performing GPS based concatenative sound synthesis, ANN retrieval based on GPS locations, HRTF based binauralization (mono->stereo using HRTF FFT-based Overlap-Add Convolution) using the IRCAM HRTF Database
C++
2
star
37

ofxOpenCV2461

ofxOpenCV linking against OpenCV 2.4.6.1, including libraries for OSX
C++
2
star
38

eegGaborAnimations

testing eeg encoding/decoding. this produces some gabor wavelets and co-registers the visualization and recording of eeg.
C
2
star
39

CADLBook

Testing
1
star
40

pkmLSH

Locality Sensitive Hashing
C++
1
star
41

freesoundDownloader

Uses cURL to download from Freesound.org
C++
1
star
42

pkmRecorder

For streaming/recording audio files, circular buffers (see pkmMatrix and pkmEXTAudioFile as well)
C++
1
star
43

pkmEXTAudioFile

pkmEXTAudioFileReader and pkmEXTAudioFileWriter provides simple interfaces to reading and writing audio files.
Objective-C
1
star
44

pkmPoseCalibrator

Calibrate head pose with respect to a screen (television/monitor) for an attention-based measure. Uses Jason Mora Saragih's FaceTracker, please contact him for the code.
C++
1
star
45

pkmHeatmap

GPU Shader implementation of common heatmap/colormaps for mapping grayscale->colormap such as JET, COOL, HOT, difference heatmaps which map to similar ranges, and support for sending point list for creating a Gaussian Mixture Model which can be visualized as a heatmap or readback for your own purposes..
C
1
star
46

CARPE-unstable

CARPE is "Computational Algorithmic Representation and Processing of Eye-movements". It supports visualizations of film/eye-movements in columnar format, peak-through visualizations, heatmaps, optical flow analysis, gaze clustering, and many other visualization options. See http://thediemproject.wordpress.com for more details. Initial release of CARPE hosted for historical purposes. Includes many experimental addons for CARPE including dROIs, GMM, GPU-Flow, and others. See also CARPE and NSCARPE for more recent, stable versions not including the experimental addons.
C++
1
star