Installation#
Requirements#
CUDA ≥ 10.2 supported GPU.
Linux with Python ≥ 3.8
PyTorch ≥ 1.6
Install using Docker#
We provide a Dockerfile which install DIRECT with a few commands. While recommended due to the use of specific pytorch features, DIRECT should also work in a virtual environment.
Docker Installation#
Use the container#
To build the image:
cd direct/
docker build -t direct:latest -f docker/Dockerfile .
To run DIRECT using all GPUs:
docker run --gpus all -it \
--shm-size=24gb --volume=<source_to_data>:/data --volume=<source_to_results>:/output \
--name=direct direct:latest /bin/bash
Requirements#
docker ≥ 19.03
Install using conda
#
First, install conda. Here is a guide on how to install conda on Linux if you don’t already have it here. If you downloaded conda for the first time it is possible that you will need to restart your machine. Once you have conda, create a python 3.9 conda environment:
conda create -n myenv python=3.9
Then, activate the virtual environment
myenv
you created where you will install the software:conda activate myenv
If you are using GPUs, cuda is required for the project to run. To install PyTorch with cuda run:
pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu116
otherwise, install the latest PyTorch CPU version (not recommended):
pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cpu
Clone the repository using
git clone
and navigate todirect/direct/
and runpython3 setup.py install
or
python3 -m pip install -e ".[dev]"
This will install
direct
as a python module.
Common Installation Issues#
If you met issues using DIRECT, please first update the repository to the latest version, and rebuild the docker. When this does not work, create a GitHub issue so we can see whether this is a bug, or an installation problem.