Set up Python, Keras, and Jupyter
This page will show you how to set up your computer to follow along with the creative prediction examples.
All of our code examples are provided as Python 3 code in jupyter notebooks, you download these to your computer or alternatively open them directy in a browser-based Python environment.
Running examples on your computer (Python/Jupyter Setup)
Basically: you need a Python 3 environment with up-to-date versions of:
keras, tensorflow, numpy, pandas, matplotlib, music21, jupyter, keras-mdn-layer
Annoyingly, there are two popular ways to set up Python on your computer: one installs python packages together in a special “environment” for each project you do, and the other sets up the packages for every project on your system.
Setup Miniconda to get the right Python
- Follow the installation instructions here
On Windows and confused? Try this page for help.
Install packages with Pip
- Open a terminal or command line window.
- Install the libraries with
pip install tensorflow tensorflow-probability keras numpy pandas matplotlib music21 jupyter glob3 svgwrite keras-mdn-layer(this might take a while).
- Start up Jupyter notebook:
- You’re ready!
Many people like to keep their Python libraries in separate “environments” for each project. If you do this, you can access each environment from Jupyter individually which is handy! Here’s how to for this.
Running examples in a browser (Google Colab)
Exercise: Try out a Google Colab Notebook
You can also run these notebooks on Google Colaboratory, a free-to-use Jupyter notebook environment that has most of the necessary Python libraries pre-installed. It even works on a tablet! If you want to get started quickly without slowing down to get your Python install right, Colab is a great way to go. The tutorials page has links ot open each example directory in Colab.
Colab has some amazing features:
- You can load all the notebooks for this workshop straight from the GitHub repo.
- You can use a GPU for free to train a biggish RNN
- Here’s some more instructions!
There are some downsides though: