1. Installing Norse#
Norse requires Python version 3.9 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:
pip- the Python package managerThis is preinstalled in most Linux and Unix distros
Note that Norse requires Python >= 3.9
torch- the deep learning acceleratorPlease follow the guide available here https://pytorch.org/get-started/locally/
Select the CUDA version if you require GPU hardware acceleration
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
Alternatively, build from source:
docker build -t norse -f publish/Dockerfile --build-arg VERSION=1.0.0 .
Replace 1.0.0 with the desired version number.
1.2.4. Installing from source#
git clone https://github.com/norse/norse
cd norse
pip install -e .
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 with Docker#
Docker creates a closed environment for you, which also means that the network and filesystem is isolated. To run with a mounted volume:
docker run -it --rm -v $(pwd):/workspace quay.io/norse/norse
1.4.1. GPU acceleration in Docker#
The Docker image includes CUDA support by default. To use GPU hardware acceleration, you need:
An NVIDIA GPU
The NVIDIA Container Toolkit installed
The
--gpus allflag when running the container
docker run -it --rm --gpus all quay.io/norse/norse python -c "import torch; print(torch.cuda.is_available())"
The --ipc=host flag is recommended for multiprocessing and DataLoader with multiple workers:
docker run -it --rm --gpus all --ipc=host -v $(pwd):/workspace quay.io/norse/norse
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
Creating an issue on GitHub: norse/norse#issues
Registering on our [Discord] chat server: https://discord.gg/7fGN359
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 interfering with the installation. Try to
remove PyTorch (
pip uninstall torch),install
torchby following the official guide at pytorch.org, andreinstall Norse with your preferred method
See this issue for more information: norse/norse#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