1. Installing Norse

We have chosen to build Norse with new features such as type hints. For that reason we require Python version 3.7 or higher. If this is a problem, it is recommended to install Norse from a Docker image.

Norse builds on top of the PyTorch deep learning library, which is also our primary dependency. This has the benefit that your models are hardware accelerated, providing the prerequisites are met.

1.1. Required dependencies

Because we are relying on optimised C++ for some of the hotspots in the library, you will need to download and install CMake and PyTorch before you can install Norse. For that reason, we recommend following the PyTorch “Get Started” guide as the first step.

You might also have to install Python headers if you have not already done that. In Debian-based distros (like Ubuntu), this can be done by running apt install python3-dev.

1.2. Installation steps

Note that the following commands require access to a command line interface.

pip install norse
  • Installing from Conda

conda install -c norse norse
  • Installing from source

git clone https://github.com/norse/norse
cd norse
python setup.py install
docker pull quay.io/norse/norse
# Or, using CUDA
docker pull quay.io/norse/norse:latest-cuda

1.3. Optional dependencies

Some of the tasks require additional dependencies like Pytorch Lightning, Torchtext and Torchvision. We also offer support for Tensorboard to make it easier to visualise the training and introspect models.

1.4. Running Norse notebooks with Docker

Docker creates a closed environment for you, which also means that the network and filesystem is isolated. Without going into details, here are three steps you can take to create a Jupyter Notebook environment with Docker. You will have to replace /your/directory with the full path to your current directory.

docker run -it -p 8888:8888 -v /your/directory:/work quay.io/norse/norse bash
pip3 install jupyter
jupyter notebook --notebook-dir=/work --ip 0.0.0.0 --allow-root

The command line will now show you a URL you can copy-paste into your browser. And voila!

1.4.1. GPU acceleration

If you would like to have GPU hardware acceleration when running the latest-cuda version of the docker container, you will have to enable the NVIDIA runtime, as described here: https://developer.nvidia.com/nvidia-container-runtime.

For more information on hardware acceleration, please refer to our page on Hardware acceleration.