1. Installing Norse

We have chosen to build Norse with new Python 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 via Docker, as described below.

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

To install Norse, you need the following two dependencies:

  1. pip - the Python package manager

    • This is preinstalled in most Linux and Unix distros

    • Note that Norse requires Python >= 3.7

  2. torch - the deep learning accelerator

1.2. Installing Norse

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

1.2.1. Installing with pip

pip install norse

1.2.2. Installing from Conda

conda install -c norse norse

1.2.3. Installing with Docker

docker pull quay.io/norse/norse
# Or, using CUDA
docker pull quay.io/norse/norse:latest-cuda

1.2.4. Installing from source

git clone https://github.com/norse/norse
cd norse
python setup.py install

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 --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 in Docker

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 {ref}(page-hardware).

1.5. Installation troubleshooting

Below follows a list of known problems that hopefully address your problem. If not, please do not hesitate to reach out either by

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.5.1. Common problems

ImportError: … /norse_op.so: undefined symbol: ZN2at5addmmERKNS_6TensorES2_S2_RKN3c106ScalarES6

This is likely because an existing, incompatible version of PyTorch is interferring with the installation. Try to

  1. remove PyTorch (pip uninstall torch),

  2. install torch by following the official guide at pytorch.org, and

  3. reinstall Norse with your preferred method

See this issue for more information: https://github.com/norse/norse/issues/280

UnsatisfiableError: The following specifications were found to be incompatible with each other

This can happen during installation from Conda of Norse<=0.07. A solution is to add the conda-forge channel, like so: conda install -c norse -c conda-forge norse

Or, when creating an environment: conda create -d -c norse -n temptest2 python==3.9 norse==0.0.7